Cuestionario vinculado a una guía · Medio Nivel

Prueba sobre cómo solicitar a la IA un mejor código

La codificación de pruebas solicita especificidad, ejemplos, contexto relevante, descomposición de tareas, diseño de pruebas y revisión de los cambios generados.

Rutas de guía relacionadasImpulsando a la IA para un mejor código
Pregunta 1 de 8

¿Qué debería indicar una solicitud clara de generación de código más allá del objetivo general?

Vista previa de cada pregunta8 preguntas

Las respuestas y explicaciones aparecen a medida que realiza el cuestionario.

  1. ¿Qué debería indicar una solicitud clara de generación de código más allá del objetivo general?
    • A preferred language, framework, and test runner without describing the change
    • Relevant context, constraints, inputs and outputs, and expected behavior
    • Every neighboring module even when it does not affect the requested behavior
    • A general goal with no acceptance criteria or interface details
  2. ¿Por qué son útiles los ejemplos concretos de entrada y salida en un mensaje de codificación?
    • They always reduce generated code size
    • They guarantee the code is secure
    • They remove the need for tests
    • They clarify expected behavior and edge cases
  3. Para reproducir una prueba fallida en particular, ¿qué contexto debería incluir un desarrollador con el código relevante?
    • The failing input, expected result, observed error, and relevant function or API context
    • An expected result without the input that produced the failure
    • Only the test name and programming language, without the actual input or output
    • The full repository tree and stack trace, without identifying which test fails
  4. ¿Qué secuencia hace que una solicitud de implementación de varias partes sea más fácil de verificar a medida que avanza el trabajo?
    • Split the code by file, but defer tests and integration review until every part is generated
    • Have the assistant write separate components and infer success from its completion summary
    • Split it into small, testable tasks, review each result, then integrate the changes
    • Ask for an outline, then request all implementation at once and review only the final output
  5. ¿Qué ayuda a aclarar el hecho de solicitar pruebas junto con la implementación?
    • A test name without the inputs or expected result
    • A code-style preference unrelated to observable behavior
    • A list of implementation steps without saying what each step should produce
    • Expected inputs, outputs, and behavior that may be ambiguous
  6. Why should a developer name relevant library or framework versions?
    • It prevents the need to review dependency compatibility
    • Available APIs can vary, and suggestions should be checked against the installed version
    • It guarantees that code generated for the version has no defects
    • It ensures the assistant will use only APIs introduced after that version
  7. Before relying on a generated code change, which review sequence is strongest?
    • Review the diff, run relevant tests and checks, then assess security and compatibility
    • Review formatting and generated tests, then merge without running them
    • Run unit tests but skip checking interfaces and security-sensitive behavior
    • Ask the assistant to confirm its code is correct, then accept its test summary
  8. If an assistant’s first implementation is wrong, what is a useful next prompt?
    • Ask for a different implementation without identifying what failed
    • Remove the failing test so the implementation can proceed
    • Describe the observed discrepancy and provide a concrete failing case
    • Repeat the original request with the same context and no new evidence