News for hackers. Stuff that matters.
Re:Kite is saying farewell, and is open-sourcing all of its ... by jascination on Sunday November 20, 2022 @05:06PM (#33685936)
Out of interest, how are you using it to write tests? Do you just write "make a test for functionX" or something?

(Don't have much experience with it)

Re:Kite is saying farewell, and is open-sourcing all of its ... by premun on Sunday November 20, 2022 @05:38PM (#33686249)
It is amazing for typing out mock data. Say you're testing parsing of XML - it can easily suggest the the assertions over the data parsed from the XML. Example test that was 95% coming out of Copilot: https://github.com/dotnet/arcade-services/blob/61babf31dc63c...

It also predicts comments and logging messages amazingly well (you type "logger." add 7/10 times get what you want, sometimes even better), incorporating variables from the context around. This speeds up the tedious parts of programming when you are finalizing the code (adding docs + tracing).

Honestly, Copilot saves me so much time every week while turning chores into a really fun time.

Re:Kite is saying farewell, and is open-sourcing all of its ... by trip-zip on Sunday November 20, 2022 @06:22PM (#33686634)
I honestly thought I'd never use copilot, but when I need to write something to interface with XML via a SOAP API, boy copilot is my best friend...
Re:Kite is saying farewell, and is open-sourcing all of its ... by JustLurking2022 on Sunday November 20, 2022 @06:23PM (#33686643)
That code is wretched... Why have serializer logic embedded in a data object, especially when .NET provides generic discrete serializers?
Re:Kite is saying farewell, and is open-sourcing all of its ... by jackcviers3 on Monday November 21, 2022 @02:50AM (#33689974)
Yeah, tabnine kills it at the data entry parts of test dev as well for sure.
Re:Kite is saying farewell, and is open-sourcing all of its ... by mattwad on Sunday November 20, 2022 @05:16PM (#33686033)
The best part about it for me is just the Intellisense (in Typescript). I'm using it on probably 3/5 lines that I write as a smarter version, but I rarely use it to do more than finish the current line I am writing.
Re:Kite is saying farewell, and is open-sourcing all of its ... by satvikpendem on Sunday November 20, 2022 @05:09PM (#33685961)
Yes, if you show an example, or even have the test file open, it will make the other tests for you.
Re:Kite is saying farewell, and is open-sourcing all of its ... by dboreham on Sunday November 20, 2022 @05:31PM (#33686180)
I wonder if this says something about the nature of test code?
Re:Kite is saying farewell, and is open-sourcing all of its ... by djbusby on Sunday November 20, 2022 @05:35PM (#33686219)
Sure, it's been loads of boilerplate since forever.
Re:Kite is saying farewell, and is open-sourcing all of its ... by throwawaysleep on Sunday November 20, 2022 @06:14PM (#33686570)
Tests often have tons and tons of boilerplate
Re:Kite is saying farewell, and is open-sourcing all of its ... by jacurtis on Sunday November 20, 2022 @07:18PM (#33687101)
Test are always mostly boilerplate and rarely include anything crafty.

95% of tests are: instantiating a class, running a method, and then asserting that the result. Tests do not or should not be crafty creative code snippets. They are boring functional code blocks by design and most are very similar, only changing out inputs and assertions between tests.

Re:Kite is saying farewell, and is open-sourcing all of its ... by paledot on Sunday November 20, 2022 @07:43PM (#33687287)
I'd go so far as to say if your test is doing something crafty, you're doing tests wrong. Maybe in a mock or fixture, but that's a write-once sort of affair.

I also don't apply DRY (don't repeat yourself) to tests. Tests should be independently readable beginning to end, no context needed. After all, the true value of a unit test is to take a block of code too complicated to easily fit in your mind, and break it down into a series of examples simple enough to fit.

Re:Kite is saying farewell, and is open-sourcing all of its ... by simonw on Sunday November 20, 2022 @06:13PM (#33686561)
I wrote up some notes on a recent experience I had writing tests with Copilot here: https://til.simonwillison.net/gpt3/writing-test-with-copilot

Once you get the hang of how to prompt it (mainly through clever use of comments) it can be a HUGE time saver.