Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
ca405028
Commit
ca405028
authored
Aug 24, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more notes and a book reference to testing intro
parent
7d795c62
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
test-overview.md
docs/guide/test-overview.md
+12
-4
No files found.
docs/guide/test-overview.md
View file @
ca405028
...
@@ -13,7 +13,7 @@ is the main topic of testing chapters.
...
@@ -13,7 +13,7 @@ is the main topic of testing chapters.
Developing with tests
Developing with tests
------------------
------------------
Test-Driven Development (TDD)
or, in another terms, Behavior-Driven Development (BDD) is an approach
of developing
Test-Driven Development (TDD)
and Behavior-Driven Development (BDD) are approaches
of developing
software by describing behavior of a piece of code or the whole feature as a set of scenarios or tests before
software by describing behavior of a piece of code or the whole feature as a set of scenarios or tests before
writing actual code and only then creating the implementation that allows these tests to pass verifying that intended
writing actual code and only then creating the implementation that allows these tests to pass verifying that intended
behavior is achieved.
behavior is achieved.
...
@@ -26,12 +26,15 @@ The process of developing a feature is the following:
...
@@ -26,12 +26,15 @@ The process of developing a feature is the following:
-
Run all tests and make sure they all pass.
-
Run all tests and make sure they all pass.
-
Improve code and make sure tests are still OK.
-
Improve code and make sure tests are still OK.
> **Tip**: If you feel that you are loosing time doing a lot of simple changes try covering more by your test scenario
After it's done the process is repeated again for another feature or improvement. If existing feature is to be changed,
> so you do more changes before executing tests again. If you're debugging too much try doing the opposite.
tests should be changed as well.
> **Tip**: If you feel that you are loosing time doing a lot of small and simple iterations try covering more by your
> test scenario so you do more before executing tests again. If you're debugging too much try doing the opposite.
The reason to create tests before doing any implemenation is that it allows you to focus on what do we want to achieve
The reason to create tests before doing any implemenation is that it allows you to focus on what do we want to achieve
and fully dive into "how to do it" afterwards. Usually it leads to better abstractions and easier test maintenance when
and fully dive into "how to do it" afterwards. Usually it leads to better abstractions and easier test maintenance when
it comes to feature adjustments.
it comes to feature adjustments
in for of less coupled components
.
So to sum up pros of such approach are the following:
So to sum up pros of such approach are the following:
...
@@ -65,3 +68,8 @@ In some cases any form of automated testing could be overkill:
...
@@ -65,3 +68,8 @@ In some cases any form of automated testing could be overkill:
-
It's one-time project that's going to be expired.
-
It's one-time project that's going to be expired.
Still if you have time it's good to automate testing in these cases as well.
Still if you have time it's good to automate testing in these cases as well.
Further reading
-------------
-
[
Test Driven Development: By Example / Kent Beck
](
http://www.amazon.com/Test-Driven-Development-Kent-Beck/dp/0321146530/
)
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment