admin管理员组

文章数量:1291122

A continual sticking point for my team has been our "Common" library. (Looking at related questions here, it might be more correct to say "Framework").

This currently consists of v1, v2, and v3. Where v3 is used for all new apps. It contains multiple WCF services, a class library with business objects, and a mon web directory for js/css/images.

We want to do things right as we go forward, especially since we have all actively begun contributing to the mon library. It's turning into a big ball of mud, and deploying it is frightening for everyone.

Our first thoughts are to set up a test server that runs unit tests across all the code to make sure nothing breaks. The problem is that writing tests for everything is extremely tedious, and frankly no one has that kind of time. We are also all inexperienced with writing proper unit tests. With that said, we'll get it done if that's the best route to go.

After that, we're not too sure. We see the mon code as a place to apply continuous integration practices, since there are many varied applications we write that utilize it.

This also introduces questions such as copying DLLs local, or having everything on one server somewhere. We are already feeling like we're in DLL Hell, and want to get out.

What are strategies that (good) software shops use to manage a situation like this?

Any and all advice is appreciated. If more information is needed, just ask. I'll be happy to provide it.

Thanks!

A continual sticking point for my team has been our "Common" library. (Looking at related questions here, it might be more correct to say "Framework").

This currently consists of v1, v2, and v3. Where v3 is used for all new apps. It contains multiple WCF services, a class library with business objects, and a mon web directory for js/css/images.

We want to do things right as we go forward, especially since we have all actively begun contributing to the mon library. It's turning into a big ball of mud, and deploying it is frightening for everyone.

Our first thoughts are to set up a test server that runs unit tests across all the code to make sure nothing breaks. The problem is that writing tests for everything is extremely tedious, and frankly no one has that kind of time. We are also all inexperienced with writing proper unit tests. With that said, we'll get it done if that's the best route to go.

After that, we're not too sure. We see the mon code as a place to apply continuous integration practices, since there are many varied applications we write that utilize it.

This also introduces questions such as copying DLLs local, or having everything on one server somewhere. We are already feeling like we're in DLL Hell, and want to get out.

What are strategies that (good) software shops use to manage a situation like this?

Any and all advice is appreciated. If more information is needed, just ask. I'll be happy to provide it.

Thanks!

Share Improve this question asked May 1, 2012 at 20:31 IronicMuffinIronicMuffin 4,20212 gold badges50 silver badges91 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 8

The problem is that writing tests for everything is extremely tedious, and frankly no one has that kind of time

The real problem is that you wrote your code without a TDD approach (tests should be written first), now in a project where testing is the focus (it should happen in every project) the tests usually take more time or the same time to write that writing the real code. Why? Because when following a TDD when you are writing your tests you are actually designing your code and you follow this pattern red-green-refactor

You should definitely start writing tests for your code, the problem now (and I am daring to take this assumption) is that you and your team did not write testable-code.

Check this thread https://stackoverflow./a/10365073/1268570

Assuming not all of your code was written to be testable, create unit-tests will be a real pain, you could write however some kind of integration tests.

About the CI server, you should go and implement it, actually a CI should not be optional for every serious project

I am actually creating a tool to simplify the integration with CI servers, it consist of a set of MSBuild scripts wrapping third party tools to perform mon tasks that every project should follow, I have not released yet cos I am not done writing documentation but it is functional now you could take a look at:

https://github./jupaol/NCastor/tree/develop

Check the develop branch, since I won't merge to master until I release a new version

About versioning, to leave "dll hell" as you say, that makes me think that you do not have a versioning standard, I would remend you to check the Semantic Versioning model:

http://semver/

BTW a good strategy I have found to distribute new ponent versions internally in an organization is to setup a private Nuget server, and publish to that server Nuget packages of your ponents. Of course to make this happen, you need to package your ponents as Nugets, but that's really easy to do.

Take this article as a reference and put all your efforts in:

  • Use a TDD approach writing unit-tests

  • Write clean testable code

  • Implement a CI server

http://misko.hevery./2008/07/16/top-10-things-i-do-on-every-project/

Tools I would remend you to use when writing tests:

  • AutoFixture

  • Moq

  • FluentAssertions

frankly no one has that kind of time.

... but you have plenty of time to correct the issues "it" causes after the fact?

If anything, create smoke tests for the apps consuming "mon" that will run through the core features to make sure they still work after a new mon release.

After that, look into some code coverage tools to see what you're not testing. Then, as a team, you can add projects that build up coverage gradually.

<soapbox>
You should be writing unit tests, especially for "mon" code, since that code could change at the whim of a developer who uses it in slightly different ways.
</soapbox>

Get yourself 2 books and make them required reading.

  1. "Working Effectively with Legacy Code" by Michael Feathers
  2. "Art of Unit Testing" by Roy Osherove

The first book will teach you best practices for working with legacy code and refactoring to patterns, and how to get meaningful unit tests around your code.

The second book is an excellent resource for both the experienced unit tester and novice unit tester.

Finally never let the excuse/reason "everything is extremely tedious, and frankly no one has that kind of time." stop you from getting to good practices. One good meaningful unit test is better than none.

Make it a standard that no "new" code is written with out a unit test to support it. And get code reviews part of your routine.

Good luck and have fun.

本文标签: cRetrofitting UnitRegression Testing on a mature libraryframeworkStack Overflow