Writing Robust Code, Code Reviews, and Collaborative Development Flashcards

1
Q

What defines robust code?

A

Robust code:

Handles unexpected situations gracefully.
Resilient to errors and recovers without crashing.
Maintainable and adaptable over time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why does robustness matter in software development?

A

Enhanced Reliability: Builds user trust.
Reduced Maintenance Costs: Fewer bugs to fix.
Improved User Experience: Smoother software performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is defensive programming?

A

An approach to anticipate and handle errors to ensure resilience and maintain system stability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are best practices for error handling?

A

Catch and handle exceptions gracefully using try-catch.
Provide clear, meaningful error messages.
Apply the Fail-Fast Principle to detect and stop errors early.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is input validation important?

A

It prevents invalid or malicious data by ensuring inputs meet the required range, format, and type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the purpose of logging?

A

Records significant events and errors.
Aids in debugging and post-mortem analysis.
Helps understand software behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the goals of code reviews?

A

Catch bugs early.
Promote knowledge sharing.
Ensure adherence to standards.
Enhance code quality and maintainability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the essentials of a good code review?

A

Consistent coding style.
Readability and documentation.
Comprehensive error handling.
Adequate test coverage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What tools support automated code analysis?

A

Linters: Detect errors (e.g., ESLint).
Static Analyzers: Find vulnerabilities (e.g., TypeScript).
Code Formatters: Enforce styling (e.g., Prettier).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are best practices for version control?

A

Use Git or similar tools.
Employ branching strategies:
-Main Branch: Stable code.
-Feature Branches: New features.
-Release Branches: Finalizing versions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the steps in a collaborative Git workflow?

A

Create repository.
Clone locally.
Create a branch.
Write and commit code.
Push changes and open a pull request.
Run automated tests.
Conduct a code review.
Merge when approved.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly