Editing MicroMVDs for exchange requirements
From Wiki.OSArch
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | To guarantee the consistent and correct delivery of BIM data, exchange requirements and quality checks can be converted into computer-automated tests to check that data is entered, appropriately formatted, and that important semantic relationships between BIM entities exist. '''A test is a single sentence that a computer can use to automatically validate data.''' | |
− | To guarantee correct BIM data, | ||
− | + | For example, if an exchange requirement is to provide an IFC4 file, it may be written as <code>the file should be an IFC4 file</code>. An automated test running system will read this sentence, and verify that the requirement has been met. This automated test can be run on Windows, Mac, Linux, or any BIM server. A report will be automatically generated for stakeholders to review. | |
− | + | Three things are required to apply this testing workflow: | |
− | + | * BIM data in OpenBIM format, usually supplied by a BIM author | |
+ | * A list of exchange requirement tests, taken from the [[List of MicroMVDs]], or custom-built by a software developer | ||
+ | * A test execution program, such as [https://blenderbim.org/download.html BIMTester] | ||
− | + | Unlike other testing solutions like Solibri, MicroMVDs are non-proprietary, do not expire, are free, much lighter, are easy to change and develop, and are cross-platform. | |
− | |||
− | + | == Authoring test suites == | |
− | |||
− | |||
− | + | Each test suite is composed of one or more plain text files, given the file extension of <code>.feature</code>. It can be edited in any text editor, such as [https://www.vim.org/ Vim], Apple TextEdit, or Microsoft Notepad. The file name is arbitrary, but may be used to describe what it is testing. | |
− | |||
− | </ | ||
− | + | An example of the content of a single <code>*.feature</code> file is shown below. Each <code>*.feature</code> file represents a test suite and must follow the format below. | |
− | + | <pre>Feature: BIM minimum requirements | |
+ | Scenario: Check we have received an IFC file | ||
+ | Given the IFC file "project.ifc" | ||
+ | Then the file should be an IFC2X3 file | ||
− | + | Scenario: Check for model setup | |
+ | Then there is a building named "My Building" | ||
+ | Then the project should have geolocation data | ||
− | + | Scenario: Check for correct IFC classifications | |
+ | Then the element 3p_TRXKdzF2wWH87Oi_za1 is an IfcSlab | ||
+ | Then the element 02Z83vdEbAgfTHGQKEXMFV is an IfcFurniture | ||
+ | Then the element 3zR58KMpzF49WT78FdAdPh is an IfcWall | ||
+ | </pre> | ||
− | + | A feature file always starts by defining the name of the <code>Feature</code>, in this case <code>BIM minimum requirements</code>. It is then followed by one or more <code>Scenario</code> blocks. Each scenario has a name that focuses on a particular exchange requirement, and contains one or more test sentences. Each sentence checks data related to the scenario. The feature name and scenario names can be anything, but must be prefixed by <code>Feature: </code> and <code>Scenario: </code> respectively. The test sentences within each <code>Scenario</code> block must match a pattern defined in the MicroMVD for the project, and must be prefixed with <code>Given </code>, <code>When </code>, or <code>Then </code>. | |
− | == | + | == Packaging test suites for recipients == |
− | |||
− | + | The author of the test suite will provide a folder named <code>features/</code>. The contents of this folder will contain: | |
− | + | <pre>features/test-suite-A.feature # This is a test suite | |
− | + | features/test-suite-B.feature # This is another test suite, you can have multiple | |
− | + | features/environment.py # This defines the test environment | |
+ | features/template.html # This is the HTML report template | ||
+ | features/steps/steps.py # The defines the test sentences | ||
+ | </pre> | ||
− | + | These files constitute the full test system, and must be shared in full to all recipients and all authors. This ensures full transparency of exchange requirements. | |
− | + | The <code>steps.py</code> file requires basic programming knowledge to understand and modify, and is generally only modified by the test author. Recipients are free to inspect it to gain a better understanding of what constitutes test compliance. | |
− | + | The <code>environment.py</code> file contains the environment settings to run the tests, using the [https://github.com/behave/behave Behave] system. An intermediate knowledge of <em>Behave</em> and <em>Python</em> is required to modify this file. For most recipients, this file must be left alone. | |
− | + | The <code>template.html</code> file contains a HTML report template. It is plain HTML code with [https://mustache.github.io/ Mustache] for the templating language. A basic knowledge of HTML and Mustache is required to modify this file, which is self-explanatory. | |
− | |||
− | |||
− | + | == Receiving and running test suites == | |
− | + | A recipient will receive a <code>features/</code> directory. They are not required to modify the files in any way. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | The | + | The cross-platform, free software [https://blenderbim.org/download.html BIMTester] tool is capable of running the test suite and generating reports. The BIMTester tool expects the <code>features/</code> directory to be in the current working directory. |
− | + | Recipients are encouraged to run the tests and generate reports at their convenience. The test author may optionally provide an automated platform which runs tests and generate downloadable reports, as well as track progress on test results. | |
− | + | == Maintaining test suites == | |
− | + | The test suite will be working document that will grow throughout the project lifecycle to ensure that data quality regressions are not made, and that the level of information which has been audited is clearly documented. | |
− | + | The test author will advise all recipients whenever new tests are being introduced or new test sentences are being defined. |