Refactoring Himock

xiaoxiao2021-03-06  100

These days have seen the information that can be found on Mock Objects, and finally I have a little understanding;

In fact, it is also to warm XP, TDD again ...

Seeing this here, you must be surprised, do you need to work hard!

These but each advertisement is agile, the development of XP developers must do every day - as long as the code is written;

Just like the DB of wiped PP, there is no need to remind, even a kind of instinct!

Yes, it is that!

Unfortunately, you have previously worked on your mother-in-one - and it's just a taste -_-!

Just roughly browsing the code of Himock, Easymock, JMOCK, with some views:

JMOCK:

The taste of the TDD in the code is obvious, and the entire frame is filled with Unit Testing and Acceptance Test for easy reconstruction and expansion; secondly its directory structure (package) organization is very clear, especially the catalog structure of the test class.

Easymock:

The catalog structure organizes very failed, where the MockControl class acts up to 1500 rows - terrible!

One problem exists in both projects:

Coding specification, do not say to follow the Sun's Java coding specification, but the code requirements are consistent coding specifications across the project, which makes people look comfortable; of course, it is best to have some necessary comments.

I remember that the purpose of downloading Junit last year is just to see the master's code; after decompression, after the grass browsing a few classes, it is very disappointed - no comments, the coding specification is inconsistent. In short, at least looks not beautiful; so I will give up carefully studying! Although I still have some sweat now, this is indeed worth paying attention!

Himock:

Need to be reconstructed for the entire project after developing a beautiful coding specification, including the reorganization of the directory structure (those who are long-awkward class names will be solved); there is a complete test class, whether the directory structure should be Learn from JMOCK? Use Maven to manage the project, is this directory structure?

转载请注明原文地址:https://www.9cbs.com/read-123426.html

New Post(0)