Module 15: Build Pipelines | CMSC 240 Software Systems Development - Fall 2024

Module 15: Build Pipelines

Resources

Setup

In order to view the generated documentation in HTML, install the Live Preview webpage previewer for VS Code extension.

LivePreview

Exercise 1 - Document generation with doxygen:

  1. Review the code in the GitHub repository for this module.
  2. Edit the file BankAccount.h and add doxygen comment annotations to each method, member variable, class, and file.
  3. These comments should include all of the following annotations when needed: @file, @class, @brief, @param, @return, @throw or @exception.
  4. Add a documentation generation target to the Makefile.
     docs: main.cpp BankAccount.cpp BankAccount.h
         doxygen doxyfile
    
  5. Also add docs target as a dependency to the all target.
  6. Run the Makefile to build the documentation.
  7. View the documentation and verify your new comments are included.

Exercise 2 - Static Analysis with cppcheck:

  1. Add a static analysis target to the Makefile.
     static-analysis:
         cppcheck *.cpp
    
  2. Also add the static-analysis target as a dependency to the all target.
  3. Run the Makefile to view the static analysis results.
  4. Fix any issues in the code found during static analysis.

Exercise 3 - Unit Testing with doctest:

  1. Review the test case provided in the BankAccountTests.cpp file.
  2. Add any tests needed to get full code coverage of the BankAccount.cpp file.
  3. Add a target to the Makefile that will build the unit test program.
     BankAccountTest: BankAccountTest.cpp BankAccount.cpp BankAccount.h
         g++ BankAccountTest.cpp BankAccount.o -o BankAccountTest
    
  4. Add a run unit tests target to the Makefile.
     run-unit-tests: BankAccountTest
         ./BankAccountTest
    
  5. Also add the run-unit-tests target as a dependency to the all target.
  6. Run the Makefile to run the unit tests and review the results.
  7. Fix any issues with the code or the tests if needed.