Mit dem Guide verknüpftes Quiz · Mittel Ebene
So schreiben Sie Codedokumentation mit AI Quiz
Erfahren Sie, wie Sie KI zur Eingabe von Codedokumenten auffordern, Beispiele anhand der Implementierung validieren und generierte Erklärungen korrekt halten können.
Frage 1 von 8
Ein Assistent erstellt einen Dokumentstring für eine Funktion, die einen Dateipfad validiert. Was sollte der Entwickler zuerst überprüfen?
Sehen Sie sich jede Frage in der Vorschau an8 Fragen
Während Sie am Quiz teilnehmen, werden Antworten und Erklärungen angezeigt.
- Ein Assistent erstellt einen Dokumentstring für eine Funktion, die einen Dateipfad validiert. Was sollte der Entwickler zuerst überprüfen?
- The described inputs, return value, side effects and edge cases against the code and tests
- Whether the prose uses the most technical vocabulary
- Whether the comment is longer than the function
- Whether the model sounds confident
- In einer README-Datei heißt es, dass ein von der KI generierter Setup-Befehl ausgeführt werden soll. Was ist ein starker Validierungsschritt?
- Assume it works because the command is familiar
- Remove all installation steps
- Run it in a clean environment and confirm it matches the project scripts and configuration
- Ask the assistant to repeat the command with more confidence
- Welcher Inline-Kommentar ist am nützlichsten?
- A paraphrase of the next line with no added context
- A note explaining a non-obvious invariant or reason for the code
- A claim that the function is secure without evidence
- A list of unrelated TODOs
- Ein generiertes API-Beispiel importiert einen plausiblen Paketnamen, der nicht im Repository verwendet wird. Was soll passieren?
- Keep it because the package name looks conventional
- Change the dependency file to match the example without review
- Delete the API documentation
- Check the import against actual dependencies and run the example
- Warum sollten Entwickler es vermeiden, Geheimnisse an einen nicht genehmigten Codierungsassistenten zu senden?
- The code or context may be processed under data-handling terms that have not been approved
- Secrets make comments harder to read
- The assistant needs every credential to understand a function
- A README cannot describe a credential safely
- A performance paragraph claims an algorithm is O(n), but no analysis or test supports it. What is the responsible edit?
- Keep it because asymptotic notation sounds precise
- Ask the model to invent a benchmark
- Remove or qualify the claim until it is verified
- Replace it with a security guarantee
- A new CLI flag changes behavior. When should its documentation be updated?
- Only after users report that the README is wrong
- With the code change and review, including a checked example
- Never, because flags are discoverable from source
- After deleting the tests
- Why might a code assistant describe an incorrect design reason even when it reads the function?
- Source code contains every team decision automatically
- Tests always explain product intent completely
- Documentation never needs human input
- The rationale or operational context may not be inferable from source code alone