Code Quality / Version Control Flashcards
How is version control usually tracked?
Changes are usually identified by a number or letter code, termed the “revision number”, “revision level”, or simply “revision”.
What is the purpose of a version control system?
Revision control allows for the ability to revert a document to a previous revision, which is critical for allowing editors to track each others edits, correct mistakes, and defence against vandalism.
Define Git
Git is a command line client software that supports access to both local and remote repositories.
Define github
GitHub is a web-based Git Repository hosting service
Define Repo
Acronym for a repository - A set of files that are grouped together as a project
What are the six main Git commands? What do they do?
Init - creates Git repo Add - adds in files Commit - the act of adding source code changes to the repo Clone - clones a repo in a new directory (useful for starting a new branch from a remote repo) Checkout - switches branches Merge - merges changes back to the head
What is a programming guideline?
A document that describes the best practices for a particular programming language or technology that guides a programmer to produce a program that can easily be understood by others using the same language or technology
What are the 6 main useful items on a programming guideline?
- naming - general readability - statement order (whether to declare variables at top of block or when needed - general programming rules - comment structure - minimized duplication (dry- refactor code into classes/function)
What are the 3 main types of white box testing?
Peer Review
- general information review process
Walthrough
- More systematic/detailed review of work
- will code meet required specs
- did some aspect of the spec get missed or misunderstood
Inspections
- Fairly formal (review of application of standard/specific guidelines)
eg. systems that may impact human safety
What are data reference errors?
Are the correct variables being used
What are Data Declaration Errors?
Is the correct type being used?
In many cases the compiler (strongly typed) will assist in detecting problems with data type. This can be an issue in loose type programming languages (eg. PHP/JavaScript)
What are Computation Errors?
Is the calculation correct?
Need to verify with another method - Hand, calculator, separate app
How do you check for Comparison?
Are all conditions correct?
Need to be careful when creating multiple condition expressions and when using negative logic
How do oyou check the control of flow?
Check the loops entries and exits
Are the entry and exit conditions for flow control set correctly?
What are parameter errors?
Method input and output
Are the parameters used within a function call correctly specified and is there a verifivation of the values - range checking