Skip to content

Commit d1ff856

Browse files
committed
[doc] cppnow-2017
1 parent 67c9602 commit d1ff856

File tree

1 file changed

+60
-40
lines changed

1 file changed

+60
-40
lines changed

docs/cppnow-2017/index.html

Lines changed: 60 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,13 +1035,13 @@
10351035
#####Manual DI - Wiring mess
10361036

10371037
```cpp
1038-
App::App(const TReader&, IPrinter&);
1038+
App::App(const Reader& reader, Printer& printer);
10391039
```
10401040

10411041
```cpp
10421042
int main() {
1043-
auto reader = MyReader{}; // WIRING!
1044-
auto printer = ConsolePrinter{}; // WIRING!
1043+
auto reader = Reader{}; // WIRING!
1044+
auto printer = Printer{}; // WIRING!
10451045
auto app = App{reader, printer}; // WIRING!
10461046
app.run();
10471047
}
@@ -1258,7 +1258,7 @@
12581258
| | | |
12591259
|-|-|-|
12601260
| TDD | Test Driven Development | Unit Tests |
1261-
| BDD | Behaviour Test Driven Development | Unit/Integration Tests |
1261+
| BDD | Behaviour Test Driven Development | Integration/Acceptance Tests |
12621262

12631263
----
12641264

@@ -1323,13 +1323,11 @@
13231323
Then The 42 should be printed
13241324
```
13251325

1326-
1327-
```
1328-
```
1326+
`test/features/file_viewer`
13291327

13301328
----
13311329

1332-
### BDD - Gherkin/Cucumber (Integration Testing)
1330+
### BDD - Gherkin/Cucumber (Acceptance Testing)
13331331

13341332
```cpp
13351333
GIVEN("^I have a file with a (\\d+) in it$") {
@@ -1362,20 +1360,33 @@
13621360
}
13631361
```
13641362

1363+
`file_viewer.cpp`
1364+
13651365
----
13661366

1367-
## BDD - DI/Mocking (Unit Testing)
1367+
### BDD - Gherkin/Cucumber
1368+
1369+
#### Run
1370+
```sh
1371+
./cucumber test/features/file_viewer
1372+
```
13681373

13691374
```cpp
1370-
"[scenario] Value from a file is displayed"_test {
1371-
auto [app, mocks] = testing::make<App>()
1375+
Feature: File Viewer
13721376
1373-
GIVEN(mocks<Readable>(), read().WillOnce(Return(42));
1377+
Scenario 1: Value from a file is displayed # test/.../file_viewer:12
1378+
Given I have a file with a 42 value in it # file_viewer.cpp:22
1379+
And the App is created # file_viewer.cpp:33
1380+
When The App runs # file_viewer.cpp:34
1381+
Then The 42 should be printed # file_viewer.cpp:48
13741382
1375-
WHEN(app.run());
1383+
```
13761384

1377-
THEN(mocks<Printable>(), print(42));
1378-
}
1385+
#### Output
1386+
```cpp
1387+
1 scenario (1 passed)
1388+
4 steps (4 passed)
1389+
0m0.015s
13791390
```
13801391

13811392
----
@@ -1462,7 +1473,7 @@
14621473

14631474
<img style="background:none; border:none; box-shadow:none;" src="images/ts_cd.png" width="75%" />
14641475

1465-
#### Loosely coupled components (it's not a class diagram)
1476+
#### Loosely coupled components (VISION)
14661477

14671478
----
14681479

@@ -1494,12 +1505,21 @@
14941505

14951506
----
14961507

1497-
### Planning (Team velocity ~12 Story Points)
1508+
### Planning (No design/workshop)
14981509

1499-
* [0.0.1] Parse feeds (3SP) <- COMMIT
1500-
* [0.0.2] Handle buy (8SP) <- COMMIT
1510+
#### Estimates
1511+
* [0.0.1] Parse feeds (3SP)
1512+
* [0.0.2] Handle buy (8SP) (~3x more complex than [0.0.1])
15011513
* [0.0.3] Handle sell (2SP)
15021514

1515+
---
1516+
1517+
#### Commitment (Team velocity ~12 Story Points)
1518+
* [0.0.1] Parse feeds <- COMMIT (3SP)
1519+
* [0.0.2] Handle buy <- COMMIT (3SP + 8SP)
1520+
1521+
> Story Point - a number that tells the team how hard the story is
1522+
15031523
----
15041524

15051525
### Sprint - Let's do it!
@@ -1657,25 +1677,6 @@
16571677

16581678
----
16591679

1660-
### TDD/Refactor - Extract to separate files if needed
1661-
1662-
```cpp
1663-
#ifndef CONCEPTS_MARKET_DATA_HPP
1664-
#define CONCEPTS_MARKET_DATA_HPP // concepts/market_data.hpp
1665-
1666-
namespace trading_system::concepts {
1667-
inline namespace v1 {
1668-
1669-
using MarketData = decltype( Callable<void()>($(connect)) &&
1670-
Callable<void()>($(disconnect)) );
1671-
} // v1
1672-
}} // trading_system::concepts
1673-
1674-
#endif
1675-
```
1676-
1677-
----
1678-
16791680
### TDD/Refactor - Cleanup the code
16801681

16811682
```cpp
@@ -1700,6 +1701,25 @@
17001701

17011702
----
17021703

1704+
### TDD/Refactor - Extract to separate files if needed
1705+
1706+
```cpp
1707+
#ifndef CONCEPTS_MARKET_DATA_HPP
1708+
#define CONCEPTS_MARKET_DATA_HPP // concepts/market_data.hpp
1709+
1710+
namespace trading_system::concepts {
1711+
inline namespace v1 {
1712+
1713+
using MarketData = decltype( Callable<void()>($(connect)) &&
1714+
Callable<void()>($(disconnect)) );
1715+
} // v1
1716+
}} // trading_system::concepts
1717+
1718+
#endif
1719+
```
1720+
1721+
----
1722+
17031723
### And so on...
17041724

17051725
----
@@ -1747,7 +1767,7 @@
17471767

17481768
<img style="background:none; border:none; box-shadow:none;" src="images/checks.png" />
17491769

1750-
#### Merged by a team member, only if:
1770+
#### Merged by a team member, only if DOD is satisfied:
17511771
* All code review dicussions were resolved
17521772
* All checks are passing
17531773
* All tests/static,dynamic analysis, etc...
@@ -1761,7 +1781,7 @@
17611781
| | [0.0.2] Handle Buy | <- Take the next story... (in priority order) |
17621782

17631783
<img style="background:none; border:none; box-shadow:none;" src="images/done.png" />
1764-
* #### Pair with someone else of the team! (knowledge sharing)
1784+
#### Pair with someone else of the team! (knowledge sharing)
17651785

17661786
==============================================================================
17671787

0 commit comments

Comments
 (0)