You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiler already has pretty good integration test coverage, but is lacking in unit tests. It would make refactoring easier if we had more granular unit tests for the different stages, such as parsing (for subscripts, variables, equations) and code generation.
I'm currently working on adding unit tests for each of these stages. The initial plan is to write unit tests that utilize the existing sample models (from the models directory). This way we will get similar coverage as in the integration tests, except these unit tests target a specific phase, so it will make it easier to pinpoint issues when I get around to refactoring these layers.
I won't be making any changes to the implementation of the compiler at this stage, only adding tests. These will essentially be snapshot tests that capture the output of the current compiler implementation. Later, when I get a chance to refactor the different phases (goal is to make the parsing code less Vensim specific), the goal is to have the new code produce exactly the same results as the existing code, so the snapshot approach will be helpful here.
The text was updated successfully, but these errors were encountered:
The compiler already has pretty good integration test coverage, but is lacking in unit tests. It would make refactoring easier if we had more granular unit tests for the different stages, such as parsing (for subscripts, variables, equations) and code generation.
I'm currently working on adding unit tests for each of these stages. The initial plan is to write unit tests that utilize the existing sample models (from the
models
directory). This way we will get similar coverage as in the integration tests, except these unit tests target a specific phase, so it will make it easier to pinpoint issues when I get around to refactoring these layers.I won't be making any changes to the implementation of the compiler at this stage, only adding tests. These will essentially be snapshot tests that capture the output of the current compiler implementation. Later, when I get a chance to refactor the different phases (goal is to make the parsing code less Vensim specific), the goal is to have the new code produce exactly the same results as the existing code, so the snapshot approach will be helpful here.
The text was updated successfully, but these errors were encountered: