1

Now I'm engaged in creating test cases for application writing on Erlang. I use common-test for it. This tool is useful and suits me. But most of the tests have the same structure and sometimes contain the same code. So, I have a lot of 'copy/paste'. It's not good. Would like to optimize my work. Probably, somebody had the same problem and found a solution. Please, help me!

pulitta
  • 43
  • 1
  • 5

2 Answers2

1

Two possible solutions:

  • Refactor your test code so that the common structure is a separate function that is reused by each test. Wrangler can help you refactor any Erlang code automatically, including tests.
  • Switch over to EUnit so that you can use Test generating functions.
aronisstav
  • 7,755
  • 5
  • 23
  • 48
1

EUnit http://www.erlang.org/doc/apps/eunit/chapter.html

QuviqCheck - http://www.quviq.com/products/erlang-quickcheck/ - Good introduction can be found here: http://roberto-aloi.com/erlang/notes-on-erlang-quickcheck/

ProPer https://github.com/manopapad/proper/ - is a QuickCheck-inspired open-source property-based testing tool for Erlang

fycth
  • 3,410
  • 25
  • 37