Do you use unit/integration tests in your development?

Just want to discuss the importance of unit and integration tests (especially if you are building reusable code portions such as frameworks or shared libraries). You might need to spend 30-50% extra time to develop and maintain unit tests, but this will pays back very quickly. Here is a video of how I employ unit and integration tests to maintain the xCAD.NET framework: Automated regression testing in xCAD.NET - YouTube

This framework is core for all my products and bespoke developments and as the framework is actively developing and changing it is vital to ensure its quality. Unit and integrations tests allow quick regression testing both on new versions and service packs of SOLIDWORKS as well as the changes in the framework as well.

Do you use unit and integration tests in your projects? What is your time allowance (%) for the unit and integration tests? Do you integrate automatic tests in your CI/CD (if applicable)?


Up until now, I’ve just been running manual tests which I know doesn’t catch everything. I feel like moving to unit and integration tests would be a good idea but I don’t necessarily know where to start.

I have not done much SW unit testing but I think Artem is absolutely right. Will try xCAD+.

We have an internal awesome framework for testing PDM and task add-ins which is a hybrid between unit and integrations tests. I have used to spend hours testing my add-ins in the past. Now every small change can be tested in a few seconds.

@artem : I do feel everyone in the SW PDM API development sphere is using integration vs proper unit testing. It’s almost impossible to mock all interfaces, use cases, conditions, models and get a proper unit test results. I find very hard to write a unit that does not depend on the API runtime. Thoughts?

@BigCrazyAl, I still perform plenty of manual testing. One type is what I call ‘chaotic’ tests where I open DebugView, enable verbose logging, and do random testing trying to catch something, and another type is Test Plan driver. I also do what I call ‘Scenario Test Plan’ where I have created a scenario (step-by-step) that is in a way similar to the demo so it naturally goes through all features of the product. After you repeat it 10 times you start to memorize the steps and it can be done much quicker (plus you can assign the priority to each step, and can do short tests, medium or full tests). This should be written separately (you just imagine the demo and write it not looking into the software), ideally it should be written by someone else who is a user of your tool, but not a developer. I am finding this to be quite helpful as I can catch lots of things.

@AmenJlili, this is spot-on for most of the things. But in xCAD there are quite a lot of complex toolkit features (not simple wrappers around APIs), such as PMPage builder and enum-based command manager. Those are using a lot of C# reflection features so quite easily unit-testable, but I still have way more Integration tests than unit tests by exact same reason you have specified.