Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I was reading a paper that makes a comparison between ASP.NET Web Forms and ASP.NET MVC. While reading it, such as data-driven, event-driven, test-driven are the terms that I see a lot. So what are they used for? when we can call them for a programming language or framework? What do they need to have?

share|improve this question

migrated from stackoverflow.com Nov 16 '11 at 3:08

This question came from our site for professional and enthusiast programmers.

4 Answers 4

up vote 9 down vote accepted

Your examples are not comparable to each other.

  • Test-driven development drives the development process via automated tests. You don't write code until a test case exists for it and is failing. You write the code to make the unit test pass. This drives the development process forward.

  • Data-driven applications drive the flow of the application via external data. You don't know what the application will do unless you have an input file to drive it. At some level, a batch script could be seen as data to drive the shell process. This is not the only possible type of example though, because the term "data-driven" is a very loose term.

  • Event-driven applications drive the flow of the application via events. A winapi application is an example of an event driven application. The main guts of the application are based on a tight loop that checks for events, and firing off callback functions when events are raised. SAX is also an example of this.

One of your examples drives the development process. The other two drive the application flow. They are not in any way comparable or orthogonal to each other. In fact you could have an application that used all three techniques.

As for "etc", you can't hand-wave. Every example is completely different.

There is a lot of "driving" going on within the development process. In fact you could say that development is a "caffeine-driven" or "profit-driven" process.

Definition of the word Driven

  1. Operated, moved, or controlled by a specified person or source of power.
  2. Motivated or determined by a specified factor or feeling.

So you can see that "driven" isn't the important part. The important part is what is driving, and what results that has on the final product (speed of delivery, quality, success of the resulting product - many factors).

You'll have to read, research, and probably experience each technique to tell you whether each will be more useful in some situations, or less useful in others.

share|improve this answer

Replace it with drives and they make sense.

  • Data Driven: Data drives the behavior of the application
  • Event Driven: Events drive the updating of the graphical UI.
  • Test Driven: Testing drives the way I write code.

Examples:

If the primary storage of the application is a database, or there's a rule engine where the rules are expressed as data, you could say the application is data driven.

If the an engine or model set of generic APIs fire events which the graphical interface uses to update the data shown to the user, you could say the application is event driven.

If the way I write code is to write tests first to prove the API works before others consume it, you could say my development is test driven.

share|improve this answer

In terms of test-driven, -"driven" means we write code specifically so that we see results in . So, if we are test-driven, we write our code specifically to pass the tests, and hope that the test-writers wrote relevant tests, since we do not care if the user likes it; it passed the test.

As for event and data driven, it is self-explanatory: Without data, the program does not work. The more data it is given, the better it works. As for Event-driven, the program does not even run without an event happening and triggering a call to it.

So, to answer your question, "-driven" is simply a colloquialism to refer to code that depends on some entity to be successful, whether it be good tests, lots of data, or an event occurring. It can mean different things in different contexts.

share|improve this answer
1  
Often in test-driven development the test-writer is the developer, or someone doing pair-programming with them. This won't prevent them from writing irrelevant tests though :) –  Merlyn Morgan-Graham Nov 16 '11 at 1:33
    
"X-driven" does not meant that a program depends on X, it means that the X is the primary controller of the way a program or process executes. –  Jay Elston Nov 18 '11 at 22:14

Simply places the emphasis on the motivational characteristics that defines how a solution is found to a problem.

In other words it anchors the point of view from which one creates the system. It should not be interpreted as a mutually exclusive to other points of views, unless that is, one gets religious about it. Rather it defines very quickly to other peer programmers what hat to put on when looking at the system to gain a faster understanding of it.

Sadly, as all other efficient means of communications it is often abused and misused, one always need to remove any marketing veneer around such definition. Whatever remains will bring you closer to enlightenment.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.