Team 6's implementation of a Static Program Analyzer (SPA) for the SIMPLE programming language and PQL query language.
- Operating System: Microsoft Windows 10
- VCS: Git
- IDE: Visual Studio 2019 (Enterprise edition recommended)
- C++ GUI framework: QT v5.11.1 (32-bit installation)
- Clone this Git repository locally with the URL https://github.com/CS3203-Team-6/SPA.git
- Navigate to the folder
/Team06/Code06/
and open the solution fileStartupSPASolution.sln
in Visual Studio 2019 (any version) - Build the solution in Visual Studio, with either the
AutoTester
(for CLI) orGui
(for GUI) project set as the starting project.- If using the GUI setup, ensure that the project has been set to use Qt version 5.11.1.
- This can be done by right-clicking the solution in the Solution Explorer > Change Solution's Qt version, then selecting the appropriate version.
- The compiled executable
Gui.exe
will be placed in\Team06\Code06\Debug
It is essential that the solution is built for the correct build type, since the AutoTester executables produced by both do not exhibit the same behaviour.
The two main build types are:
- DEBUG: build with no optimisations, ensuring full semantics of the source code
- RELEASE: build with moderate compiler optimisations, improving performance but potentially causing incorrect execution where undefined behaviour exists
Since the evaluation of the SPA project is performed on the RELEASE build, all testing should be performed on only the RELEASE build. The key exception to this is:
- The DEBUG build should be used when performing unit or integration tests with code coverage analysis in Visual Studio, since the compiler optimisations introduced result in the RELEASE build reporting incorrect coverage metrics
Until specified otherwise, Visual Studio defaults to building the DEBUG build. The build type can be changed by:
- Right click on the solution file > Properties > Configuration Properties > Configuration Manager > select "Release" from the Active solution configuration dropdown menu
- Navigate to the respective build output folders with your shell (Git Bash recommended for Windows); the compiled executables are here
- DEBUG build:
Team06\Code06\Debug
- RELEASE build:
\Team06\Code06\Release
- DEBUG build:
- To run the AutoTester with an input SIMPLE program file and input query file:
./AutoTester.exe <SIMPLE_FILE> <QUERY_FILE> <OUTPUT_FILE>
- The output will be generated as
<OUTPUT_FILE>.xml
which may be viewed in Internet Explorer or Mozilla Firefox
- The output will be generated as
The Powershell script runAllSysTest.ps1
allows the AutoTester to be run with multiple test suites, with logging output for the status of each test suite (with failing testcases).
This script will always test the RELEASE build of the AutoTester if available. Otherwise, it will issue a warning that the DEBUG build is being tested instead.
- Navigate to the root folder
- Edit
runAllSysTest.ps1
to specify the list of test suites to run- A test suite comprises a SIMPLE source program file and a corresponding query file (if the SIMPLE program is valid)
- For each test suite added, include the test prefix (eg.
..\calls_0
); the..\
is needed for tests not in the\regression_tests
directory) - Existing test suites can be skipped by commenting the corresponding test prefix out
- Type in your shell the command
powershell ".\runAllSysTest.ps1"
- Powershell requires permission to run external scripts; this can be se twith the command
powershell -Command 'Set-ExecutionPolicy -ExecutionPolicy RemoteSigned' while running as administrator
)
- Powershell requires permission to run external scripts; this can be se twith the command
- If necessary, the full test outputs can be inspected in the
.\Team06\Test06
folder or corresponding sub-folder
Prerequisites: Visual Studio 2019 (Enterprise edition)
The Enterprise edition of Visual Studio comes with the code coverage feature. The code coverage analysis will be run on both the unit and integration tests, and should be done only for the DEBUG build.
- Click on the 'Test' menu in the toolbar, then select "Analyse Code Coverage for All Tests"
- After all tests have run, a code coverage report will be generated and presented in the Code Coverage Results window
- To highlight coverage of individual lines in the source code, click on 'Show Code Coverage Coloring' in the Code Coverage Results window
We are employing Travis CI as our CI framework, and it automates the following tasks:
- Compilation and building of the SPA solution for the RELEASE build
- Execution of all unit and integration tests
- Regression testing and performance benchmarking of the RELEASE build of the AutoTester executable
- Detection of coding standard violations (modified Google C++ style guide)
The following are expectations:
- No direct commits or force-pushes are allowed to the
master
orextensions
branches - Use the branching workflow with merging
- No self-approval of branches
- Do not merge failing branches
- PRs should only introduce features from the Advanced SPA OR extensions, and not both concurrently
- PRs adding extension features should target the
extensions
branch, and include the latest commits frommaster
- A lot of coffee and sleepless nights