¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: [TDD] How to use TDD to test a process?

 

Here is the a list of possible tests for the UserService.Record method:

?

?? Record__UserWithSameNameAlreadyExists__DeleteTheUser ???????????????????????????????????????????????? // Asserts only on calling the method _userDao.Delete with appropriate arguments ¨C you have to use a mock to do this

?? Record__ UserWithSameNameAlreadyExists _DeleteFailed__ReturnsFalse ?????????????????????? // Asserts on the method Record returning false ¨C you have to use a stub here to ensure that Delete returns false

?? Record__ UserWithSameNameAlreadyExists__SavesNewUserDetails?????????????????????????????????? // Asserts only on calling the method _userDao.Save with appropriate arguments (the passed user in this case) ¨C again a mock is needed

?? Record__ UserWithSameNameAlreadyExists_SavingFailed__ReturnsFalse????????? ??????????????? // Asserts again that the method Record should return false ¨C a stub for the method Save to return false

?

(The test names are written using the notation ____)

?

Pl. note that this is the minimum no. of tests that the method Record can have (given its cyclomatic complexity - 4)

There may be other cases, which evolve depending on the data complexity, which gives more dimensions to the above tests. For ex. there may be null data, which is probably expected/not expected to be handled by the method.

?

It is also but usual to be tempted to assert on more than one expected result in a single test, but the best practices prescribe not to do so, as it may be not be clear - which expectation failed.

?

One way to check if you have enough tests is to see, if the list of tests are giving you the functional specification of the method under test. It is more efficient and useful technique in a test first approach, where the unit test spec could be checked before coding. Also, it may be possible to sort out glitches like, whether the userDao is actually expected user name or id.

?

Best Regards,

Surya


On Tue, Apr 26, 2016 at 10:11 AM sailor.gao@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:
?

Thanks for the reply.
Yes, actually I don't want to know the side effect. I just want to test the logic. I had planned to use stub or mock. But there are several branches. I thought it is a little duplicated. Because if gotten good code coverage, in every case I have to write the stub or mock for methods called. Could you give me some advice? Thank you.


Re: [TDD] How to use TDD to test a process?

 

Thanks for the reply.
Yes, actually I don't want to know the side effect. I just want to test the logic. I had planned to use stub or mock. But there are several branches. I thought it is a little duplicated. Because if gotten good code coverage, in every case I have to write the stub or mock for methods called. Could you give me some advice? Thank you.


Re: [TDD] How to use TDD to test a process?

Donaldson, John
 

Sailor.gao, your question is not very clear.
I suppose you want to know if method Record actually calls GetUser then Delete or Save?

So, either you reason by the side effects (such as the record has gone from the database),
or you use a mock of some kind to show you call the expected methods in the expected order.

John D.

From: testdrivendevelopment@... [mailto:testdrivendevelopment@...]
Sent: 25 April 2016 14:37
To: testdrivendevelopment@...
Subject: [TDD] How to use TDD to test a process?





I try to use stub but it seems not very good. I want to know how should I write the test case, and how many should it be? Could someone help me? Thank U!

logic like this:



public class User

{

public int ID

{

get;set;

}

public String Name

{

get;set;

}

public String BrokerID

{

get;set;

}

public String Timestamp

{

get;set;

}

}



public interface IUserDao

{

User GetUser(string userID,string brokerID);

bool Save(User user);

bool Delete(User user);

}



public UserService

{

private IUserDao _userDao;

public UserService(IUserDao userDao)

{

_userDao=userDao;

}



public bool Record(User user)

{

User origin=_userDao.GetUser(user.Name,user.BrokerID);



if(orign)

{

if(!_userDao.Delete(origin))

{

return false;

}

}



if(!_userDao.Save(user))

{

return false;
}
; return true;

}

}


How to use TDD to test a process?

 

I try to use stub but it seems not very good. I want to know how should I write the test case, and how many should it be? Could someone help me? Thank U!

logic like this:


public class User

{

??? public int ID

??? {

??????? get;set;

??? }

??? public String Name

??? {

???????? get;set;

??? }

??? public String BrokerID

??? {

???????? get;set;

??? }

??? public String Timestamp

??? {

???????? get;set;

??? }

}


public interface IUserDao

{

??? User GetUser(string userID,string brokerID);

??? bool Save(User user);

??? bool Delete(User user);

}


public UserService

{

??? private? IUserDao _userDao;

??? public UserService(IUserDao userDao)

??? {

????????? _userDao=userDao;

??? }

???

?? public bool Record(User user)

?? {

???????? User origin=_userDao.GetUser(user.Name,user.BrokerID);


???????? if(orign)

???????? {

??????????? if(!_userDao.Delete(origin))

??????????? {

?????????????????? return false;

???????????? }

???????? }


???????? if(!_userDao.Save(user))

???????? {

????????????????? return false;

???????? }??
? ? ? ?? return true;?

?? }

}


Re: TDD Database migration code

 

Check out ?for database migrations and?for database testing.


Re: [TDD] TDD Database migration code

 

A tool as Liquibase () would not help??

>>*The short version is:
?>>1. A command which generates a .sql file with a timestamp in the file name.
In liquibase you create de .sql files.
>> ?2. A?command which checks all the files in a folder,?and then does some comparisons to another db, and picks one or more .sql files to run on the db in question.
I think that is exactly what liquibase does.



On Wed, Apr 20, 2016 at 9:01 AM, Avi Kessner akessner@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:

?

Ironically, after attempting to install pgTap and get it talking with python instead of perl, I ended up removing all the tests and DB specific code.

Mainly because of what you were advising just now. The custom use cases were making my tests too brittle, so I found a better way to abstract it out.

It will be good later on though if we have more complicated db functions, though hopefully I'll be able to persuade the team to avoid that.

brought to you by the letters A, V, and I
and the number 47

On Wed, Apr 20, 2016 at 2:17 PM, Adam Sroka adam.sroka@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:
?

You are welcome!

General advice: be cautious about building functionality into the database. The database should be optimized for storage and retrieval. Decisions about how to ask the right questions of the database should probably be in a layer closer to the customer, and in the language appropriate to that place.?

On Wed, Apr 20, 2016 at 1:06 AM, Avi Kessner akessner@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:
?

PgTap looks perfect. Thanks!

On Apr 20, 2016 10:59 AM, "Avi Kessner" <akessner@...> wrote:
Ideally I'm looking for something that creates databases, runs sql, is able to check the state of the database, and then destroys the database.

I don't really care at what level that happens at. (Though easier is obviously better) ?.. (investigating pgtap now, thanks)

brought to you by the letters A, V, and I
and the number 47

On Wed, Apr 20, 2016 at 10:21 AM, Adam Sroka adam.sroka@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:
?

Are you talking about test driving database access code from a general purpose language? Or are you talking about test driving stuff inside the database engine? There is??but I would look for a way to do it at a higher level, unless... a gun was pointed at my head.?

On Tuesday, April 19, 2016, akessner@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:

?

My google searches are giving me bad results... :(

Does anyone know of any good articles, or have any good hints, on how to do TDD for writing PostgresSQL, or database code?

I need to write a custom system which allows us to do DB migrations and updates etc, a bit similar to what Ruby on Rails with has?their?DB rake:migration command.*

Google is mostly giving me information on how to abstract out DB objects, but I need to verify that my new custom migration system is actually working.

The tests I would want to write are simples
? ?1. Confirm that a migration file worked (say by adding a column)
? ?2. Confirm that only the latest migration was run, and not a previous one (say by checking a value in the table wasn't changed)

I appreciate the help you can provide.

*The short version is:
?1. A command which generates a .sql file with a timestamp in the file name.
? 2. A?command which checks all the files in a folder,?and then does some comparisons to another db, and picks one or more .sql files to run on the db in question.



?







--
Abra?os,
´³´Ç²õ³Ü¨¦


Re: [TDD] TDD Database migration code

 

Ironically, after attempting to install pgTap and get it talking with python instead of perl, I ended up removing all the tests and DB specific code.

Mainly because of what you were advising just now. The custom use cases were making my tests too brittle, so I found a better way to abstract it out.

It will be good later on though if we have more complicated db functions, though hopefully I'll be able to persuade the team to avoid that.

brought to you by the letters A, V, and I
and the number 47

On Wed, Apr 20, 2016 at 2:17 PM, Adam Sroka adam.sroka@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:

?

You are welcome!

General advice: be cautious about building functionality into the database. The database should be optimized for storage and retrieval. Decisions about how to ask the right questions of the database should probably be in a layer closer to the customer, and in the language appropriate to that place.?

On Wed, Apr 20, 2016 at 1:06 AM, Avi Kessner akessner@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:
?

PgTap looks perfect. Thanks!

On Apr 20, 2016 10:59 AM, "Avi Kessner" <akessner@...> wrote:
Ideally I'm looking for something that creates databases, runs sql, is able to check the state of the database, and then destroys the database.

I don't really care at what level that happens at. (Though easier is obviously better) ?.. (investigating pgtap now, thanks)

brought to you by the letters A, V, and I
and the number 47

On Wed, Apr 20, 2016 at 10:21 AM, Adam Sroka adam.sroka@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:
?

Are you talking about test driving database access code from a general purpose language? Or are you talking about test driving stuff inside the database engine? There is??but I would look for a way to do it at a higher level, unless... a gun was pointed at my head.?

On Tuesday, April 19, 2016, akessner@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:

?

My google searches are giving me bad results... :(

Does anyone know of any good articles, or have any good hints, on how to do TDD for writing PostgresSQL, or database code?

I need to write a custom system which allows us to do DB migrations and updates etc, a bit similar to what Ruby on Rails with has?their?DB rake:migration command.*

Google is mostly giving me information on how to abstract out DB objects, but I need to verify that my new custom migration system is actually working.

The tests I would want to write are simples
? ?1. Confirm that a migration file worked (say by adding a column)
? ?2. Confirm that only the latest migration was run, and not a previous one (say by checking a value in the table wasn't changed)

I appreciate the help you can provide.

*The short version is:
?1. A command which generates a .sql file with a timestamp in the file name.
? 2. A?command which checks all the files in a folder,?and then does some comparisons to another db, and picks one or more .sql files to run on the db in question.



?





Re: [TDD] TDD Database migration code

 

You are welcome!

General advice: be cautious about building functionality into the database. The database should be optimized for storage and retrieval. Decisions about how to ask the right questions of the database should probably be in a layer closer to the customer, and in the language appropriate to that place.?

On Wed, Apr 20, 2016 at 1:06 AM, Avi Kessner akessner@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:

?

PgTap looks perfect. Thanks!

On Apr 20, 2016 10:59 AM, "Avi Kessner" <akessner@...> wrote:
Ideally I'm looking for something that creates databases, runs sql, is able to check the state of the database, and then destroys the database.

I don't really care at what level that happens at. (Though easier is obviously better) ?.. (investigating pgtap now, thanks)

brought to you by the letters A, V, and I
and the number 47

On Wed, Apr 20, 2016 at 10:21 AM, Adam Sroka adam.sroka@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:
?

Are you talking about test driving database access code from a general purpose language? Or are you talking about test driving stuff inside the database engine? There is??but I would look for a way to do it at a higher level, unless... a gun was pointed at my head.?

On Tuesday, April 19, 2016, akessner@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:

?

My google searches are giving me bad results... :(

Does anyone know of any good articles, or have any good hints, on how to do TDD for writing PostgresSQL, or database code?

I need to write a custom system which allows us to do DB migrations and updates etc, a bit similar to what Ruby on Rails with has?their?DB rake:migration command.*

Google is mostly giving me information on how to abstract out DB objects, but I need to verify that my new custom migration system is actually working.

The tests I would want to write are simples
? ?1. Confirm that a migration file worked (say by adding a column)
? ?2. Confirm that only the latest migration was run, and not a previous one (say by checking a value in the table wasn't changed)

I appreciate the help you can provide.

*The short version is:
?1. A command which generates a .sql file with a timestamp in the file name.
? 2. A?command which checks all the files in a folder,?and then does some comparisons to another db, and picks one or more .sql files to run on the db in question.



?




Re: [TDD] TDD Database migration code

 

PgTap looks perfect. Thanks!

On Apr 20, 2016 10:59 AM, "Avi Kessner" <akessner@...> wrote:

Ideally I'm looking for something that creates databases, runs sql, is able to check the state of the database, and then destroys the database.

I don't really care at what level that happens at. (Though easier is obviously better) ?.. (investigating pgtap now, thanks)

brought to you by the letters A, V, and I
and the number 47

On Wed, Apr 20, 2016 at 10:21 AM, Adam Sroka adam.sroka@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:
?

Are you talking about test driving database access code from a general purpose language? Or are you talking about test driving stuff inside the database engine? There is??but I would look for a way to do it at a higher level, unless... a gun was pointed at my head.?

On Tuesday, April 19, 2016, akessner@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:

?

My google searches are giving me bad results... :(

Does anyone know of any good articles, or have any good hints, on how to do TDD for writing PostgresSQL, or database code?

I need to write a custom system which allows us to do DB migrations and updates etc, a bit similar to what Ruby on Rails with has?their?DB rake:migration command.*

Google is mostly giving me information on how to abstract out DB objects, but I need to verify that my new custom migration system is actually working.

The tests I would want to write are simples
? ?1. Confirm that a migration file worked (say by adding a column)
? ?2. Confirm that only the latest migration was run, and not a previous one (say by checking a value in the table wasn't changed)

I appreciate the help you can provide.

*The short version is:
?1. A command which generates a .sql file with a timestamp in the file name.
? 2. A?command which checks all the files in a folder,?and then does some comparisons to another db, and picks one or more .sql files to run on the db in question.



?



Re: [TDD] TDD Database migration code

 

Ideally I'm looking for something that creates databases, runs sql, is able to check the state of the database, and then destroys the database.

I don't really care at what level that happens at. (Though easier is obviously better) ?.. (investigating pgtap now, thanks)

brought to you by the letters A, V, and I
and the number 47

On Wed, Apr 20, 2016 at 10:21 AM, Adam Sroka adam.sroka@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:

?

Are you talking about test driving database access code from a general purpose language? Or are you talking about test driving stuff inside the database engine? There is??but I would look for a way to do it at a higher level, unless... a gun was pointed at my head.?

On Tuesday, April 19, 2016, akessner@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:

?

My google searches are giving me bad results... :(

Does anyone know of any good articles, or have any good hints, on how to do TDD for writing PostgresSQL, or database code?

I need to write a custom system which allows us to do DB migrations and updates etc, a bit similar to what Ruby on Rails with has?their?DB rake:migration command.*

Google is mostly giving me information on how to abstract out DB objects, but I need to verify that my new custom migration system is actually working.

The tests I would want to write are simples
? ?1. Confirm that a migration file worked (say by adding a column)
? ?2. Confirm that only the latest migration was run, and not a previous one (say by checking a value in the table wasn't changed)

I appreciate the help you can provide.

*The short version is:
?1. A command which generates a .sql file with a timestamp in the file name.
? 2. A?command which checks all the files in a folder,?and then does some comparisons to another db, and picks one or more .sql files to run on the db in question.



?



Re: [TDD] TDD Database migration code

 

Are you talking about test driving database access code from a general purpose language? Or are you talking about test driving stuff inside the database engine? There is??but I would look for a way to do it at a higher level, unless... a gun was pointed at my head.?


On Tuesday, April 19, 2016, akessner@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:
?

My google searches are giving me bad results... :(

Does anyone know of any good articles, or have any good hints, on how to do TDD for writing PostgresSQL, or database code?

I need to write a custom system which allows us to do DB migrations and updates etc, a bit similar to what Ruby on Rails with has?their?DB rake:migration command.*

Google is mostly giving me information on how to abstract out DB objects, but I need to verify that my new custom migration system is actually working.

The tests I would want to write are simples
? ?1. Confirm that a migration file worked (say by adding a column)
? ?2. Confirm that only the latest migration was run, and not a previous one (say by checking a value in the table wasn't changed)

I appreciate the help you can provide.

*The short version is:
?1. A command which generates a .sql file with a timestamp in the file name.
? 2. A?command which checks all the files in a folder,?and then does some comparisons to another db, and picks one or more .sql files to run on the db in question.



?


TDD Database migration code

 

My google searches are giving me bad results... :(

Does anyone know of any good articles, or have any good hints, on how to do TDD for writing PostgresSQL, or database code?

I need to write a custom system which allows us to do DB migrations and updates etc, a bit similar to what Ruby on Rails with has?their?DB rake:migration command.*

Google is mostly giving me information on how to abstract out DB objects, but I need to verify that my new custom migration system is actually working.

The tests I would want to write are simples
? ?1. Confirm that a migration file worked (say by adding a column)
? ?2. Confirm that only the latest migration was run, and not a previous one (say by checking a value in the table wasn't changed)

I appreciate the help you can provide.

*The short version is:
?1. A command which generates a .sql file with a timestamp in the file name.
? 2. A?command which checks all the files in a folder,?and then does some comparisons to another db, and picks one or more .sql files to run on the db in question.



?


Re: [TDD] Behavioral challenges in adopting TDD

 

¿ªÔÆÌåÓý

Absolutely. I did this in one organization, starting with two unit tests. By the end of the week I had figured out how to add six more, and kept adding on. My work group picked up on what I was doing, and before long, the rest of the organization noticed that we had by far the best record in avoiding breaking the baseline of any group. They came over to learn. ?Within a year most of the organization was doing it as well.?

We do TDD because it gives us clearly better results. As long as your co-workers can see you attaining those results, whether it is in higher productivity or better quality, they will be faced with a choice: either you are smarter than they, or you have found a technique that works, and which they can learn. Guess which they would prefer to believe?

- Russ

On Apr 13, 2016, at 11:06 AM, Charlie Poole charliepoole@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:



This may not seem like a real answer. Save it and come back after all else fails.

Forget about all that stuff and start doing TDD. Do it by yourself. Do it with a partner if you can. Stop trying to make anybody else do anything.

You seem to be describing a situation in which neither the docs nor the manager want to use TDD, so focus on what you can control.

Maybe in six months someone will ask you about what you are doing that makes your code so good.

Charlie

On Apr 13, 2016 7:53 AM, "poojawandile@...?[testdrivendevelopment]" <testdrivendevelopment@...> wrote:
?

HI,

I am anticipating following challenges in TDD adoption. Any suggestion how to deal with such situations?


The list is long :-). Thanks,?


  1. 1.? ? ??You have a very experienced, senior and technically sound developer who has designed and developed solutions in a traditional way. This person has not completely bought in to the idea of TDD. How will you motivate such people??

  2. 2.??????The program that you are working on is complex, for that matter every program is complex, has dependencies on other systems/program/modules/components, how and where do you start with TDD? Developer fear making change/refactor as they believe any such attempt can break existing working system. They don't want to mess with something that is working.?

  3. 3.? ? ??Your team has traditionally worked in a test after situation, first write code and then write unit test cases. Time and again their mind first think of implementation logic since it has been trained that way for a long time, how do you make them unlearn this habit??

  4. 4.??????TDD will take time initially. The estimation of your project was done when TDD was not in picture. Now that you have to use TDD, how would you now negotiate with your manager and business for this extra time??

  5. 5.??????Why is singleton not considered a good design pattern. what are Technical challenges in using TDD in web applications.?


W


An










-----------------
Author,?Getting Started with Apache Maven <>
Author, HttpUnit <> and SimpleStub <>

Come read my webnovel,?Take a Lemon?<>,?
and listen to the Misfile radio play <>!




Re: [TDD] Node.js / javascript TDD Tutorials

 

Look at?. I think it is really good

br JM



2016-04-13 19:51 GMT+02:00 Adam Sroka adam.sroka@... [testdrivendevelopment] <testdrivendevelopment@...>:

?

TDD in Node.js is not substantially different than TDD in any other language. There are a dizzying array of frameworks to choose from. I have a strong preference for Jasmine as the test framework, particularly in CoffeeScript.?


If you add the browser to the mix things get complicated, particularly if you are trying to test in the browser or test code you expect to manipulate the DOM in specific ways. But, server side is exactly the same as any other language, and any old TDD book/tutorial will put you in the right direction.?

On Wednesday, April 13, 2016, reuven.yagel@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:
?

Following the previous Java thread, I'm looking for recommended and updated sources (tutorials/books/courses/etc) on TDDing javascript applications, mainly server side.

Thanks, R.




Re: [TDD] Node.js / javascript TDD Tutorials

 

TDD in Node.js is not substantially different than TDD in any other language. There are a dizzying array of frameworks to choose from. I have a strong preference for Jasmine as the test framework, particularly in CoffeeScript.?

If you add the browser to the mix things get complicated, particularly if you are trying to test in the browser or test code you expect to manipulate the DOM in specific ways. But, server side is exactly the same as any other language, and any old TDD book/tutorial will put you in the right direction.?

On Wednesday, April 13, 2016, reuven.yagel@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:
?

Following the previous Java thread, I'm looking for recommended and updated sources (tutorials/books/courses/etc) on TDDing javascript applications, mainly server side.

Thanks, R.



Re: [TDD] Node.js / javascript TDD Tutorials

 


James Shore has an extensive video course on the subject:?

On Wed, Apr 13, 2016 at 3:37 PM, reuven.yagel@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:



Following the previous Java thread, I'm looking for recommended and updated sources (tutorials/books/courses/etc) on TDDing javascript applications, mainly server side.
Thanks, R.






Re: [TDD] Behavioral challenges in adopting TDD

 

¿ªÔÆÌåÓý

Hi there,

A short answer: Patience, love, and understanding, fostered by someone who's been there/done that. Do you have any TDD-experienced folks in the team who can work with your senior dev?

A primary goal when I start pairing with devs is help them out with their current challenges, by showing them useful legacy code techniques to start getting their code under control and by helping them figure out other problems and coming up with better solutions (the primary goal of pairing). Sitting with them allows me to start working in test-first as we go along, talking about techniques, values, etc. as we go. This is effective for most devs, including senior ones. (I had one lead dev tell me "I've learned more in the past two weeks than in the past two years.")

The legacy themes and techniques quickly demonstrate how it's possible to make changes and minimize fear.

As far as the dip in productivity, it's not hard to get someone to agree that it makes logical sense and is worth the initial dip in productivity. On one simple score, most shops don't quantify a cost to develop a given feature, since they don't take into the account the cost of rework, the additional cost to understand poor code, and the true costs of defects.

Regards,
Jeff

Langr Software Solutions, Inc.


Pragmatic Unit Testing in Java?()
Modern C++ Programming with TDD ()
Agile in a Flash ()
Agile Java: Crafting Code with Test-Driven Development?()
Essential Java Style ()

On Apr 13, 2016, at 8:48 AM, poojawandile@... [testdrivendevelopment] <testdrivendevelopment@...> wrote:



HI,

I am anticipating following challenges in TDD adoption. Any suggestion how to deal with such situations?


The list is long :-). Thanks,?


  1. 1.? ? ??You have a very experienced, senior and technically sound developer who has designed and developed solutions in a traditional way. This person has not completely bought in to the idea of TDD. How will you motivate such people??

  2. 2.??????The program that you are working on is complex, for that matter every program is complex, has dependencies on other systems/program/modules/components, how and where do you start with TDD? Developer fear making change/refactor as they believe any such attempt can break existing working system. They don't want to mess with something that is working.?

  3. 3.? ? ??Your team has traditionally worked in a test after situation, first write code and then write unit test cases. Time and again their mind first think of implementation logic since it has been trained that way for a long time, how do you make them unlearn this habit??

  4. 4.??????TDD will take time initially. The estimation of your project was done when TDD was not in picture. Now that you have to use TDD, how would you now negotiate with your manager and business for this extra time??

  5. 5.??????Why is singleton not considered a good design pattern. what are Technical challenges in using TDD in web applications.?


W


An







Re: [TDD] Behavioral challenges in adopting TDD

 

This may not seem like a real answer. Save it and come back after all else fails.

Forget about all that stuff and start doing TDD. Do it by yourself. Do it with a partner if you can. Stop trying to make anybody else do anything.

You seem to be describing a situation in which neither the docs nor the manager want to use TDD, so focus on what you can control.

Maybe in six months someone will ask you about what you are doing that makes your code so good.

Charlie

On Apr 13, 2016 7:53 AM, "poojawandile@... [testdrivendevelopment]" <testdrivendevelopment@...> wrote:

?

HI,

I am anticipating following challenges in TDD adoption. Any suggestion how to deal with such situations?


The list is long :-). Thanks,?

  1. 1.? ? ? You have a very experienced, senior and technically sound developer who has designed and developed solutions in a traditional way. This person has not completely bought in to the idea of TDD. How will you motivate such people??

  2. 2.????? The program that you are working on is complex, for that matter every program is complex, has dependencies on other systems/program/modules/components, how and where do you start with TDD? Developer fear making change/refactor as they believe any such attempt can break existing working system. They don't want to mess with something that is working.?

  3. 3.? ? ??Your team has traditionally worked in a test after situation, first write code and then write unit test cases. Time and again their mind first think of implementation logic since it has been trained that way for a long time, how do you make them unlearn this habit??

  4. 4.????? TDD will take time initially. The estimation of your project was done when TDD was not in picture. Now that you have to use TDD, how would you now negotiate with your manager and business for this extra time??

  5. 5.????? Why is singleton not considered a good design pattern. what are Technical challenges in using TDD in web applications.?


W


An



Behavioral challenges in adopting TDD

 

HI,

I am anticipating following challenges in TDD adoption. Any suggestion how to deal with such situations?


The list is long :-). Thanks,?

  1. 1.? ? ? You have a very experienced, senior and technically sound developer who has designed and developed solutions in a traditional way. This person has not completely bought in to the idea of TDD. How will you motivate such people??

  2. 2.????? The program that you are working on is complex, for that matter every program is complex, has dependencies on other systems/program/modules/components, how and where do you start with TDD? Developer fear making change/refactor as they believe any such attempt can break existing working system. They don't want to mess with something that is working.?

  3. 3.? ? ??Your team has traditionally worked in a test after situation, first write code and then write unit test cases. Time and again their mind first think of implementation logic since it has been trained that way for a long time, how do you make them unlearn this habit??

  4. 4.????? TDD will take time initially. The estimation of your project was done when TDD was not in picture. Now that you have to use TDD, how would you now negotiate with your manager and business for this extra time??

  5. 5.????? Why is singleton not considered a good design pattern. what are Technical challenges in using TDD in web applications.?


W


An



Node.js / javascript TDD Tutorials

 

Following the previous Java thread, I'm looking for recommended and updated sources (tutorials/books/courses/etc) on TDDing javascript applications, mainly server side.
Thanks, R.