Using Of Fixtures/unit Testing Does somebody used?
#1
Posted 04 November 2010 - 07:37 AM
Just wanted to ask, does somebody used Yii built in unit testing option in real projects.
As for me, I never had used this option in my projects. But maybe I another kind of developer that not use unit testing.
#2
Posted 04 November 2010 - 08:47 AM
It might not be the wisest thing to do, but i have to admit writing good tests is often cumbersome and feels like doubling the effort required for a project. And if you decide to refactor, you have to refactor twice as much code. In the projects where i used tests i found, that i only had tests for the most obvious features. And writing tests for the rare tricky cases mostly wasn't easy.
Maybe i should have another look at the yii testing framework. From what i've read it should be much easier now to e.g. set up fixtures. Something i always found most tedious.
#3
Posted 04 November 2010 - 07:05 PM
I have to say that I don't usually use (rarely as Mike said) testing in my projects. What I do is to code and check every block - variable (php-js) expected results, requests - responses speeds, but through firePHP, firebug and some time checking procedures (YSlow, etc...).
Once I am happy with it, I analyse again the code and try to find the best approach to use the fastest and cleanests algorithms.
After all that work, I don't feel like doing more tests to tell you the truth. I suppose I should, but that will be when the projects I am involved require a more specific 'care' on performance and results. Once that come I will get back on the subject.
www.ramirezcobos.com
www.yiianswers.com
www.2amigos.us
www.getyiistrap.com
www.github.com/tonydspaniard
www.github.com/2amigos
#4
Posted 08 November 2010 - 08:15 AM
Working in the environment I do, the clients don't pay for testing; they pay for a website at the end of the day. So, I re-use code I know that works, which gives me confidence in the final implementation, so the testing has been done by previous implementations. So most of the websites I do may take a week (client dead-lines), and it'd prolong that process beyond that, hence unhappy clients. But, in those cases, the websites are so small, testing isn't that difficult to perform manually.
But I'm about to start developing a web-application (using Yii) that will be used as *the* core application a business to do their day-to-day work, and I want to offer a solid, tested solution. So in this case, where I have the luxury of time, and the need for it to be a solid application, I'll be using the Test Driven Development model for creating the application (as described in the Agile Web Application Development with Yii 1.1 and PHP5 book).
I'll get the reassurance that when it comes to adding new features and making bug fixes, I'll have the confidence in running the tests to know that we have locally in our development environment works and I can add new features without worrying. I'll also get the confidence to say to the client that the application works functionally based on the specifications we agree; no more, no less.
I look forward to working with the process, and while the initial learning curve will be painful (i.e. slow), it'll create a better application in the end.
#5
Posted 15 November 2010 - 07:47 AM
Tests help me to re-factor and tweak client requirements more quickly and with more confidence.
Most importantly, they help me sleep well at night ;-)
dan
#6
Posted 25 December 2010 - 07:20 PM
Crazy Wizdom, on 15 November 2010 - 07:47 AM, said:
Tests help me to re-factor and tweak client requirements more quickly and with more confidence.
Most importantly, they help me sleep well at night ;-)
dan
Totally agree with this.
I'm not really following the true TDD method, but I always write unit tests for models' methods. Because I'm using FAT model design, most of the logic is covered with tests.
Haven't used functional tests yet, needs to check that out too.
m(o_O)m
#7
Posted 03 January 2011 - 10:47 AM
szako, on 25 December 2010 - 07:20 PM, said:
I'm not really following the true TDD method, but I always write unit tests for models' methods. Because I'm using FAT model design, most of the logic is covered with tests.
Haven't used functional tests yet, needs to check that out too.
Rarely do. Same reason with Mike. After knowing Yii, I just realize there is something called TDD to reduce buggy code. Since I am quite a sloppy programmer, I think I can use this TDD method to reduce the bugs. But what happened is, after coding the unit test, I've just realised there are a lot of bugs too in my test code and I just can't help but using more time to fix the unit test to make sure it doesn't buggy geez~
Guess, I need to fix myself first before using TDD, or else it will take more time for me to write unit test.
Yii Playground : Collaborative demo apps. You can join to improve it too!
My Team's Blog: In Indonesian.
#8
Posted 06 January 2011 - 05:39 PM
Tho some days earlier I made bad test code, so It was buggy too :/ As you say ...
But the more I do it, the better I become, I hope.
m(o_O)m
#9
Posted 22 March 2011 - 04:00 PM
#10
Posted 14 March 2012 - 02:19 AM
But, I'm beginning a new project (very big project, complete rewrite of a huge VB.NET client/server application into a full web one), and I think I'll developp it with unit testing in mind...
So, I could vote "just starting" too.
#11
Posted 15 March 2012 - 08:42 AM
#12
Posted 21 March 2012 - 02:14 AM
Check Zurmo Continuous Integration details.
Unit testing helps us much when we change some existing code, and make us confident that everything is working correctly after code changes. And unit tests can be used as additional documentation and examples how to use some classes/functions.
zurmo.org
#13
Posted 02 February 2013 - 08:19 PM

Help

















