Foto de cottonbro studio

Hace muy poco que he entrado en el programa beta de GitHub Copilot Chat y solo he lanzado un test rápido, crearé un análisis para septiembre pero no quería dejar de compartir mi impresión del minuto 0, es como la foto que acompaña al artículo, literal surprised

Adjunto una captura para que veais lo sencillo que este generar un test. He usado mi poyecto Orleans Graint2Grain que hace meses que no lo cargo y solamente he entrado en el chat:

No saldrá un dialogo para que indiquemos como queremos hacer los test:

Y aquí el test, que funciona a la primera (¡vaya que si funciona!):

Mi opinión

El test es mejorable sí, pero en 5 segundos ni el más experto es capad de escribir esta primera versión del test. Por tanto, hemos aumentado la productividad y sobre todo: hemos metido test donde no los había. Cualquier persona que tenga un código legacy sin test puede inundar su aplicación de test, con un poco de conocimiento darles más forma y contexto, por tanto, hemos dado un paso de gigante.

Las otras opcines de explciarme el codigo aquí la tienes:

This is a C# program that sets up an Orleans silo host. The Main method calls the RunMainAsync method, which starts the silo host and waits for user input to stop it. If an exception is thrown, the catch block prints the exception and returns 1.

The StartSilo method creates a SiloHostBuilder object and configures it to use localhost clustering with a cluster ID of «dev» and a service ID of «Test». It then adds several application parts that contain the grains used by the silo host. Finally, it configures logging to use the console and builds the silo host.

To improve the readability of the code, the ConfigureApplicationParts method calls could be combined into a single call with multiple arguments. Additionally, the Console.WriteLine call in the Main method could be replaced with a call to Console.ReadKey to wait for user input. To improve performance, the await keyword could be removed from the RunMainAsync method’s return statement, as it is not necessary.

Corregir esto:

Y documentar, no soy partidario de este tipo de comentarios, solo para aquellos que realizan cosas muy complicadas, ya que el código debe poder hablarte: