I Asked Copilot To Write Unit Tests - It Wasn’t Great

Поділитися
Вставка
  • Опубліковано 7 січ 2025

КОМЕНТАРІ • 17

  • @konradhylton
    @konradhylton Рік тому +2

    "Will it not eat and then prepare it's own dogfood?" Asking the serious questions. Subscribed.

  • @silkogelman
    @silkogelman Рік тому +3

    Thank you Zoran, very interesting.
    I hope the upcoming Copilot Chat feature will provide more ways to make Copilot produce better tests.

  • @happy_burger
    @happy_burger Рік тому +1

    TDD application of Copilot would be interesting to see, although I have my doubts))

  • @TheSaintsVEVO
    @TheSaintsVEVO Рік тому +1

    You could press `alt + ]` to cycle through copilot suggestions I believe. So you can try that when it tries to “talk back” to you as you say

    • @zoran-horvat
      @zoran-horvat  Рік тому +3

      While that is true that it might sometimes offer a better solution in the alternatives, I never got accustomed to break the flow and read those. Actually, my impression was that using Copilot in that mode of operation doesn't save any time - and that is the primary need I have.
      I generally don't need it to write my code, I need it to write it faster than I would do. In that respect, Copilot has one chance to intervene at any given time, and if that is the miss, I get on to writing the solution myself, hoping that it will catch up at some point during the process.

  • @colorblindzebra
    @colorblindzebra Рік тому +1

    Hi thank you for the video; from my experience, chatgpt4 is quite good at generating code if I first show him templates informing it on how I want my test to look, which nuget (it does well with C# functionnal library LanguageExt), which approach/style etc.); I havent tried for TDD though (kind of scare) but do you think it might be a viable option or does the "context"-problem still holds?

  • @1usrname
    @1usrname Рік тому

    Thanks Zoran. I found your coverage of CoPilot very informative. However, I am more interested in TDD and how CoPilot can help. Is it possible to have CoPilot help write code that can pass existing tests?

    • @zoran-horvat
      @zoran-horvat  Рік тому

      I still haven't experimented with that, because it generally failed to generate good code for any kind of tests. I was more focused on making it write tests first, and that didn't work out well either.

  • @hynesie11
    @hynesie11 Рік тому

    I hope Copilot learns from the changes that developers make to its suggestions.

  • @nickbarton3191
    @nickbarton3191 Рік тому +1

    Me, I was screaming TDD from the beginning.

  • @rammrras9683
    @rammrras9683 Рік тому

    What is TDD?

  • @scvnthorpe__
    @scvnthorpe__ Рік тому +1

    I think a neat approach would be to write unit tests by hand, and then see what AI could do when asked "hey, write this code!"
    Could work a treat if you're certain about the units of your design, but the implementation is hard or unknown

    • @zoran-horvat
      @zoran-horvat  Рік тому +2

      There will be the video that does that! I am waiting to get access to Copilot X before recording.