3

do you know where we can find programs written ir c with just one module preferably, about +-200 lines of code or more to insert some bugs for testing? Programs that have none or very little small interaction so it is more easy to automate the tests?

Or do you know some kind of programs written in c that have low interaction with the user and about 200 lines of code? Or if there are already programs with test suites also can be.

Im asking this, because the programs that I find with low interaction like sorting algorithm and so on are very small for testing, like 20 or 30 lines.

1
  • Where did your professor recommend you look for sample C programs?
    – user246
    Nov 28 '16 at 12:26
3

Rosetta Stone is good place to find it: https://rosettacode.org/wiki/Category:C

In addition to typical algorithms (sorting, graph, trees), there are some code involving I/O, for instance: https://rosettacode.org/wiki/Globally_replace_text_in_several_files#C

You can test each function in isolation, creating mocks and stubs, or end-to-end, asserting various types of outputs.

1
  • Thanks for your answer. It seems there are lot of examples there. Thanks!
    – Ozzy
    Nov 25 '16 at 14:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.