Solid Java unit test automation? (JUnit/Hamcrest/…)

后端 未结 4 566
忘掉有多难
忘掉有多难 2021-02-01 18:07

Intent

I am looking for the following:

  • A solid unit testing methodology
    1. What am I missing from my approach?
    2. What am I doing wro
4条回答
  •  醉梦人生
    2021-02-01 18:43

    I see you put a lot of effort to really test your classes. Good! :)

    My comments/questions would be:

    • what about mocking? you do not mention any tool for this
    • it seems to me that you care a lot about the nitty-gritty details (I do not say they are not important!), while neglecting the business purpose of tested class. I guess it comes from the fact you code code-first (do you?). What I would suggest is more TDD/BDD approach and focus on business responsibilities of the tested class.
    • not sure what this gives you: "Method testing grouped in static nested classes"?
    • regarding auto-generation of test stubs etc. Simply put: don't. You will end up testing implementation instead of behaviour.

提交回复
热议问题