Testing
The ´bim2sim´ repository includes a multi-stage testing setup to ensure its functionality.
Unit Testing
Unit tests are used for testing individual functions. These tests can be executed very quickly and are not computationally intensive.
Integration Testing
Integration tests are used within the individual plugins for testing the functionality of the package with different IFC models. These tests deal with large IFC models and are therefore take some time for computation, so you may need to wait a few minutes until these tests are done. These tests can be used to test different simulation setups on the indidual IFC models. Depending on your integration test setup, it may include a full year run of your simulation. Here, you cannot easily tell if the changes in your coding have produced any changes in the results (use Regression Testing for this), but you can test if full simulation run works at all.
Regression Testing
Regression tests are used for quality assurance when developing new features. Here, the simulation results of selected IFC models are compared to previous simulation results. If the simulated results do not match with the regression results, the test fails. This forces the developer to have a closer look at the changes in the results, such that the developer has to decide whether to update the new implementation or the regression results.
Run Tests Local
To test mapping between IFC and our meta structure elements as well as for Integration Testing we need to load IFC files into our tool. These IFC files can be quite big. To keep the size of this repository as slim as possible we put the test resources into an additional repository, which is included here as a submodule. To make sure that you have those resources in your local repository, run:
git submodule update --init --recursive
Update test resources
If test resources needs to be updated, please follow the following procedure:
Test Resources Repository
Create a branch
update_test_resources
In this branch update the test resources as required
Push the branch with the changes to the remote repository
Main bim2sim Repository
Create a branch called
update_resources_submodule
from the currentdevelopment
branchCheckout this branch on your local device and perform the following commands in the root path:
cd test/resources
(Go into the submodule directory)git pull origin update_test_resources
(Pull the latest changes of the test resources submodule)cd ../..
(Go back to parent repo)git add test/resources
(add the changes)git commit -m "Update submodule of test resources"
git push
Wait for the pipeline to run through on your branch, this makes sure that the code runs with the new test resources without issues
If the pipeline with all tests passes, perform the following steps, otherwise fix the issues before you continue
Test Resources Repository
Create a Pull Request (PR) from
update_test_resources
into themain
branchLink the succeeded pipeline in this PR and assign a reviewer
When review finished, merge the PR
Main bim2sim Repository
Repeat the same steps as under step 6, but this time in step 6.ii use
main
insteadupdate_test_resources
as branch nameagain wait for the pipeline to succeed
Create a PR to merge
update_resources_submodule
branch in themain
branch and assign a reviewerIf pipeline has passed (what it should) and review is approved merge the PR