C18: Implementation and Quality Assurance Flashcards
Coding standards should address the following:
Define the required and optional items of the coding standards.
Define the format and language used to specify the required optional items (so the programmers know what to include).
Define the coding requirements and conventions.
Define the rules and responsibilities to create and implement the coding standards well as review and improve the practice.
What are coding standards?
A set of rules that serve as requirements and guidelines for writing programs in an organization.
What do coding standards address?
Define the required and optional items of the coding standards.
Define the format and language used to specify the required optional items (so the programmers know what to include).
Define the coding requirements and conventions. Define the rules and responsibilities to create and implement the coding standards well as review and improve the practice.
Coding standards usually include:
File Header
Description of Classes
Description of classes include:
Purpose
Description of methods
Description of fields
In-code comments
Coding conventions include:
Naming Conventions
Formatting Conventions
In-Code Comment Conventions
Why coding standards?
They define a common set of rules for writing programs in the project. Thereby ensuring consistency and facilitating project management, software integration, software reuse, configuration management, and software maintenance.
They make it easy to understand the programs within the project and ensure that important items are included to reap the benefits.
They help code review and test case generation because the functional description and incode comments help the reviewers and testers understand the program.
They facilitate the use of integration with apps such as javadoc and static analysis tools.
Code Review Checklist
- Does the program correctly implement the functionality and conform to the design specification.
- Does the implemented class interfaces conform to the interfaces the specified in the design class diagram.
- Does the implementation comply with the coding standards.
- Compute a number of the required quality metrics and identify those that are worse than the required indicators.
- Are programming constructs used correctly and properly?
- Does the program correctly implement data structures?
- Are there in error or anomalies?
- Incorrect uses of logic?
Guidelines for Practicing Code Standards
- Define barely enough coding standards - Keeps effort to a minimum while still having benefits.
- Easy to understand and practice - To actually have benefits we need developer support.
- Should be well documented and include examples - Examples are used to illustrate the required and optional items.
- Training on how to use coding standards is helpful - Helps developers understand what is required.
- Coding standards, once defined and published, should be practiced and checked for compliance regulatory - Standards that are defined but not practiced are useless.
- Assign responsibilities to individuals and make sure that all involved know the assignment.
- Practice of coding standards should involve stakeholders - Success of standards requires support from all stakeholders.
Organizing the Implementation Artifacts
- Architectural-Style organization - organizes classes according to building blocks of the software architecture.
- Functional subsystem organisation - Organises classes according to the functional subsystems of the software system.
- Hybrid organisation - Combines both of the styles above.
Test Stub Drawbacks
- Consumes time and effort.
- Is not the class it simulates.
- Retesting is always required when the actual class is implemented.
What is pair programming?
When two people work one machine where person A types and focuses on the best way to implement the functionality and person B reviews the code as it is typed.
Benefits of pair programming include:
- Reduces pressure and brings fun to programming.
- Enhance team communication because the partners exchange ideas during pair programming. Improves productivity and quality.
- It enhances mutual understanding and collaboration.
- It tends to produce simpler and more efficient solutions faster.
Limitations of pair programming include:
- It’s not for everyone - Some people work better alone.
- Discussions between partners could take a lot of time if not handled properly.
- It could be slow to start due to the need to adapt to the difference in partners skills.
- Partners have to be in the same location.
- Partners may have different schedules.
- It might not be as effective when trying to find errors.
What is ping-pong programming?
One developer writes the tests and the other implements the functionality.