Solved

DUnit - Appropriate use??

Posted on 2004-08-23
3
203 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:Mohammed Nasman
ID: 11878550
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
ID: 11879065
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
ID: 11886975
Hi Juergen,

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

Thanks for the links too, mnasman.

Stu.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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 Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

896 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

13 Experts available now in Live!

Get 1:1 Help Now