Module 15: Build Pipelines
- First read this page then start the module with the GitHub classroom link below.
- Github Classroom Link: https://classroom.github.com/a/YjhgTw3M
Resources
Setup
In order to view the generated documentation in HTML, install the Live Preview webpage previewer for VS Code extension.
Exercise 1 - Document generation with doxygen:
- Review the code in the GitHub repository for this module.
- Edit the file
BankAccount.h
and add doxygen comment annotations to each method, member variable, class, and file. - These comments should include all of the following annotations when needed:
@file
,@class
,@brief
,@param
,@return
,@throw
or@exception
. - Add a documentation generation target to the
Makefile
.docs: main.cpp BankAccount.cpp BankAccount.h doxygen doxyfile
- Also add
docs
target as a dependency to theall
target. - Run the
Makefile
to build the documentation. - View the documentation and verify your new comments are included.
Exercise 2 - Static Analysis with cppcheck:
- Add a static analysis target to the
Makefile
.static-analysis: cppcheck *.cpp
- Also add the
static-analysis
target as a dependency to theall
target. - Run the
Makefile
to view the static analysis results. - Fix any issues in the code found during static analysis.
Exercise 3 - Unit Testing with doctest:
- Review the test case provided in the
BankAccountTests.cpp
file. - Add any tests needed to get full code coverage of the
BankAccount.cpp
file. - 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
- Add a run unit tests target to the
Makefile
.run-unit-tests: BankAccountTest ./BankAccountTest
- Also add the
run-unit-tests
target as a dependency to theall
target. - Run the
Makefile
to run the unit tests and review the results. - Fix any issues with the code or the tests if needed.