Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

My current employer doesn\'t do unit testing (shudder). In fact there is no host

ID: 656918 • Letter: M

Question

My current employer doesn't do unit testing (shudder). In fact there is no host based testing at all; everything is tested (black box) on target. And none of it can be automated (the horror! the horror!).

After some nagging I have been very grudgingly given permission to look into host testing - initially at subsystem level. Not ideal, but it's a start, and it can be automated for regression testing porpoises, and, if it works, I might even get to try unit testing.

The build system for the target doesn't have anything as simple as a make file, oh no, indeedie. It has a Bash script, which runs a Perl script, which invokes a few Python scripts, which use XML files to generate build commands on the fly.

I would like to stay well away from it (maybe in the next country, maybe even in the next job).

The subsystem has 200+ .CPP files. Neither source nor header include the .H files which they need, preferring to rely on others to do so (the further horror! the further horror!). Mostly this gets done by the aptly named enums.h (or, do I mean ineptly?).

Question: I am looking for a tool which will scan those 200+ source & associated header files, and figure out which classes, functions, structures, enums, etc are referenced, but not declared and generate mocks/stubs/dummies/WhateverYouCareToCallThem, which I can expand upon for testing?

Thinks: perhaps it could just scan the compiler/linker error messages in order to determine what to create?

Windows or Linux. Preferably free, but as that is so unlikely, if there is something commercial where I can try a demo, I might be able to get them to spring for a license.

Important: it must be able to use the current production code - unchanged. Tools like Google Mocks require me to declare things as virtual solely in order to be able to test.

Explanation / Answer

Not free or even cheap but you might be able to get a demo licence but this sounds like a job for LDRA TBRun &/or LDRAunit - the nice thing is that it will quite rapidly tell you which stubs are needed and generate the framework for them, both at unit level and sub-system level.

It will also allow unit testing on the target hardware as well as on a host and provides very thorough static analysis & data flow analysis both of which might be good selling points to your boss.

I have used it a lot and to me it is a lot less work to generate useful tests than many of the competitors that I have also used.

(N.B. Just to clarify I don't work for LDRA but I do use it at work)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote