Solved

DUnit - Appropriate use??

Posted on 2004-08-23
3
202 Views
Last Modified: 2010-04-05
Hi folks,

I've been asked to look at DUnit for one of our existing projects, and I'm not really convinced it's going to be something that'll be easy to implement.

The project in question has around 200,000 lines of code in it.  It's not based around any object oriented code at all (in fact, there is a ton of Delphi 1 legacy code still in it).  There is a heap of inter-form dependencies - which may or may not be there depending on the way the method is called.  So, we could have a component on Form2 that we're using, but only if the method is called in that particular way.  Call it another way, and form2 may not even be looked at (or there for may not even be in memory).

Also, a single function may return many different results based on how it was initially called.  What this means is, within the function, a set of different parameters are checked, and depending on those parameters, different formulas/actions are used which in turn returns a different result.

It's pretty much a dogs breakfast of code.  It's been tacked onto for years now, and it's at the point now were changing something can bugger up other things due to it's heavy dependencies on shared stuff (that's bad sharing, not good sharing).  The person who recommended we use DUnit believe that we can use it to fix some of these problems.  I believe adding it into the program will just introduce even more issues and possibly won't work anyway due to the dependency issues.

Does anyone have any thoughts at all?  I know it needs to be rewritten - and it will be.  None of us have used DUnit before.

Any info greatly appreciated.

Stuart.
0
Comment
Question by:Stuart_Johnson
3 Comments
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
Hello

  I have never used DUnit for any projects, but these links maybe help you

http://www.elvenware.com/charlie/delphi/
http://www.thedelphimagazine.com/samples/1339/1339.htm

HTH
0
 

Accepted Solution

by:
jschmied earned 250 total points
Comment Utility
Hallo!

I would not see much gain from writing DJunit tests for such a project.

If you start a new development, try it in the following way:
1. - try to construct your business logic as a clean set of objects, write only the empty objects at this time
2. - define your requirements to the business logic as JUnit test cases
3. - implement the testcase
4. - implement the businesslogic

loop throu 2..4 until you are ready

Such a development helps to get a clean implementation.

Bye

Juergen


0
 
LVL 6

Author Comment

by:Stuart_Johnson
Comment Utility
Hi Juergen,

That's what I thought too.  Thanks for that.

Thanks for the links too, mnasman.

Stu.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now