Code Quality / Version Control Flashcards

1
Q

How is version control usually tracked?

A

Changes are usually identified by a number or letter code, termed the “revision number”, “revision level”, or simply “revision”.

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

What is the purpose of a version control system?

A

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.

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

Define Git

A

Git is a command line client software that supports access to both local and remote repositories.

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

Define github

A

GitHub is a web-based Git Repository hosting service

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

Define Repo

A

Acronym for a repository - A set of files that are grouped together as a project

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

What are the six main Git commands? What do they do?

A

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

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

What is a programming guideline?

A

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

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

What are the 6 main useful items on a programming guideline?

A
  • 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)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the 3 main types of white box testing?

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are data reference errors?

A

Are the correct variables being used

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

What are Data Declaration Errors?

A

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)

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

What are Computation Errors?

A

Is the calculation correct?

Need to verify with another method - Hand, calculator, separate app

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

How do you check for Comparison?

A

Are all conditions correct?

Need to be careful when creating multiple condition expressions and when using negative logic

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

How do oyou check the control of flow?

A

Check the loops entries and exits

Are the entry and exit conditions for flow control set correctly?

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

What are parameter errors?

A

Method input and output

Are the parameters used within a function call correctly specified and is there a verifivation of the values - range checking

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

How do you check the Application input and output?

A

Are the data inputs/outputs matched to the appropriate variables?

17
Q

What are the four different comment types that should be included in newly developed software?

A
  1. Overall Desctiptive
  2. Code Explanation
  3. Documentation
  4. Domain / Business
18
Q

What should be contained in overall / descriptive comments?

A
  • What does the module / component accomplish at a high level
  • typically at the top of a module
19
Q

What should be contained in code explaining comments?

A
  • Details on “non-trivial” code that may be unclear to a junior level programmer within that environment.
  • well-written code should be someone self-explanatory.
20
Q

What should be contained in documentation comments?

A
  • Extractable comments by programming tools
  • JavaDoc - Jave
  • Sandcastle - .NET
  • Doxygen - Open source, many languages
  • HeaderDoc - Apple
  • Description of how class/method should be called and expectation of parameter values
21
Q

What should be contained in the Domain / Business Comments?

A
  • Explains the business rules that have been implemented in the code, what and why references.

eg.

22
Q

What are the 6 questions you need to ask about a certain technology?

A
  • Is the language / framework mature?
  • Does it have a significant user base
  • Will the client specify the technology?
  • Will it perform?
  • can it be scaled?
  • is it portable?
  • Does the technology have:
  • Programming Guidelines?
  • Quality processes/tools to assist in testing?
23
Q

What are the two main Questions to ask when trying to choose the right technology?

A
  • Does the client require a specific technology?
  • Client / Team may have experience / training in only specific technologies.
  • Does the development team:
  • Have training in the technology
  • Have previously successfully deployed technology in an existing solution similar to the solution being proposed.
  • Use best practices to maintain the code
  • Source Code Control
  • Coding Best Practices’
  • Have the ability to hire people well versed in the technology (full-time or contract)
24
Q

Benefits of commenting?

A

It is important to leave behind proper communication for new eyes, or even your own eyes at a later date to speed up maintenance of the code which is inevitable.