{"id":20228,"date":"2018-12-16T09:00:36","date_gmt":"2018-12-16T00:00:36","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=20228"},"modified":"2018-12-16T09:15:46","modified_gmt":"2018-12-16T00:15:46","slug":"drivendevelopment","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2018\/12\/16\/drivendevelopment\/","title":{"rendered":"\u65b0\u4eba\u304c\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u306b\u3064\u3044\u3066\u5b66\u3093\u3067\u307f\u305f\u3002"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002<br \/>\nTECHSCORE BLOG\u521d\u53c2\u6226\u306e\u4e2d\u897f\u3067\u3059\u3002<br \/>\n\u3053\u308c\u306f<a href=\"\/blog\/2018\/11\/22\/techscore-advent-calendar-2018\/\">\ud83d\ude3aTECHSCORE Advent Calendar 2018\ud83d\ude3a<\/a>\u306e16\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n<p>\u7686\u3055\u3093\u306f<strong>\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a<\/strong>\u3068\u3044\u3046\u8a00\u8449\u3092\u3054\u5b58\u77e5\u3067\u3057\u3087\u3046\u304b\uff1f<br \/>\n\u958b\u767a\u306b\u643a\u308f\u3063\u3066\u3044\u308b\u65b9\u306f\u3001\u4e00\u5ea6\u306f\u8033\u306b\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u8a00\u8449\u3060\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u65b0\u4eba\u306e\u79c1\u304c\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3092\u4e00\u304b\u3089\u5b66\u3076\u306b\u3042\u305f\u308a\u3001\u57fa\u672c\u7684\u306a\u3068\u3053\u308d\u3067\u3059\u304c\u8abf\u3079\u305f\u3053\u3068\u3092\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u3053\u308c\u304b\u3089\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u306b\u3064\u3044\u3066\u8abf\u3079\u308b\u4eba\u306e\u53c2\u8003\u306b\u306a\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n<h2>\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3092\u5b66\u3076\u304d\u3063\u304b\u3051<\/h2>\n<p>\u79c1\u306f\u958b\u767a\u306e\u65b0\u4eba\u3068\u3057\u3066\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u30c6\u30b9\u30c8\u696d\u52d9\u304b\u3089\u59cb\u3081\u307e\u3057\u305f\u3002<br \/>\n\u30c6\u30b9\u30c8\u696d\u52d9\u306b\u95a2\u308f\u308b\u4e2d\u3067\u3001\u5f97\u305f\u77e5\u8b58\u3092\u958b\u767a\u3067\u6d3b\u304b\u305b\u306a\u3044\u304b\u3068\u8003\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u305d\u3053\u3067\u5148\u8f29\u304b\u3089\u30a2\u30c9\u30d0\u30a4\u30b9\u3055\u308c\u305f\u306e\u304c\u3001<strong>\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a<\/strong>\u3067\u3059\u3002<br \/>\n\u81ea\u5206\u304c\u8eab\u306b\u7740\u3051\u305f\u30c6\u30b9\u30c8\u306e\u77e5\u8b58\u3092\u958b\u767a\u306b\u6d3b\u304b\u305b\u308b\u3053\u306e\u65b9\u6cd5\u306f\u3001\u79c1\u306b\u3068\u3063\u3066\u307e\u3055\u306b\u7406\u60f3\u7684\u306a\u5b58\u5728\u3067\u3001<br \/>\n\u8abf\u3079\u3066\u307f\u3088\u3046\u3068\u5f37\u304f\u601d\u3044\u3001\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u304f\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2>\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u306b\u3064\u3044\u3066<\/h2>\n<p>\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u306f\u300c\u30c6\u30b9\u30c8\u300d\u3068\u540d\u524d\u304c\u4ed8\u3044\u3066\u3044\u308b\u3053\u3068\u304b\u3089\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30c6\u30b9\u30c8\u624b\u6cd5\u306e\u3088\u3046\u306b\u611f\u3058\u3089\u308c\u307e\u3059\u304c\u3001\u5b9f\u969b\u306f\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u958b\u767a\u624b\u6cd5\u306e\u4e00\u3064\u3067\u3059\u3002<br \/>\n\u3053\u306e\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3067\u3059\u304c<strong>\u300c\u30c6\u30b9\u30c8\u30d5\u30a1\u30fc\u30b9\u30c8\u300d<\/strong>\u3068\u3044\u3046\u8003\u3048\u65b9\u304c\u57fa\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u304c\u30c6\u30b9\u30c8\u30d5\u30a1\u30fc\u30b9\u30c8\u306e\u8003\u3048\u65b9\u3068\u7279\u5fb4\u3067\u3059\u3002<\/p>\n<ul>\n<strong>\u8003\u3048\u65b9<\/strong><br \/>\n\u30fb\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u524d\u306b\u3001\u305d\u306e\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u306b\u3064\u3044\u3066\u306e\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3059\u308b\u3002<br \/>\n<strong>\u7279\u5fb4<\/strong><br \/>\n\u30fb\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u521d\u3081\u306b\u66f8\u304f\u305f\u3081\u3001\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u304c\u6301\u3064\u5f79\u5272\u3092\u306f\u3063\u304d\u308a\u3068\u3055\u305b\u3084\u3059\u3044\u3002<br \/>\n\u30fb\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3068\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u304c\u30bb\u30c3\u30c8\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u306e\u4fee\u6b63\u6642\u306b\u305d\u308c\u306b\u5bfe\u5fdc\u3059\u308b\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u518d\u5229\u7528\u3067\u304d\u308b\u3002<br \/>\n\u30fb\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u304b\u3089\u305d\u308c\u306b\u901a\u308b\u3088\u3046\u306a\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001\u5358\u4f53\u30c6\u30b9\u30c8\u306e\u56de\u6570\u3092\u5897\u3084\u3059\u3053\u3068\u304c\u3067\u304d\u30d0\u30b0\u304c\u5c11\u306a\u304f\u306a\u308b\u3002\n<\/ul>\n<p>\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u306f\u4e0a\u8a18\u306e\u8003\u3048\u65b9\u3068\u7279\u5fb4\u3092\u53d7\u3051\u7d99\u304e\u3064\u3064\u3001\u3088\u308a\u5b9f\u8df5\u7684\u304b\u3064\u6d17\u7df4\u3055\u308c\u305f\u3082\u306e\u3068\u3057\u3066\u958b\u767a\u73fe\u5834\u3067\u5229\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u5de5\u7a0b\u3092\u4e0a\u304b\u3089\u9806\u306b\u7e70\u308a\u8fd4\u3057\u3066\u958b\u767a\u3092\u9032\u3081\u308b\u3053\u3068\u304c\u539f\u5247\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u5931\u6557\u3059\u308b\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u66f8\u304f<\/li>\n<li>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u901a\u904e\u3059\u308b\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3059\u308b<\/li>\n<li>\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u3092\u3059\u308b<\/li>\n<\/ol>\n<p><a href=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/tech_score_pic1.png\" rel=\"facebox\" rel=\"attachment wp-att-20473\"><img loading=\"lazy\" class=\"alignnone size-medium wp-image-20473\" src=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/tech_score_pic1-300x225.png\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/tech_score_pic1-300x225.png 300w, https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/tech_score_pic1.png 640w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h2>\u5931\u6557\u3059\u308b\u30c6\u30b9\u30c8\u3068\u306f\uff1f<\/h2>\n<p>\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3067\u521d\u3081\u306b\u3059\u308b\u5de5\u7a0b\u304c\u3001\u5931\u6557\u3059\u308b\u30c6\u30b9\u30c8\u3092\u66f8\u304f\u3053\u3068\u3067\u3059\u3002<br \/>\n\u79c1\u306e\u7d4c\u9a13\u306b\u306f\u306a\u308a\u307e\u3059\u304c\u3001\u4e09\u3064\u306e\u5de5\u7a0b\u306e\u4e2d\u3067\u7406\u89e3\u304c\u6700\u3082\u96e3\u3057\u304b\u3063\u305f\u3068\u8a00\u3044\u5207\u308c\u308b\u5de5\u7a0b\u3067\u3059\u3002<\/p>\n<p>\u5f53\u521d\u3001\u6587\u9762\u3092\u305d\u306e\u307e\u307e\u53d7\u3051\u53d6\u3063\u3066\u3044\u305f\u79c1\u306f\u3001<br \/>\n<strong>\u300c\u30a8\u30e9\u30fc\u30d1\u30bf\u30fc\u30f3\u3092\u78ba\u304b\u3081\u308b\u30c6\u30b9\u30c8\u3092\u3001\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u306e\u5b9f\u88c5\u524d\u306b\u66f8\u304f\u300d<\/strong><br \/>\n\u3068\u3057\u3066\u3001\u3042\u308c\u3084\u3053\u308c\u3084\u3068\u30a8\u30e9\u30fc\u30d1\u30bf\u30fc\u30f3\u3092\u8003\u3048\u3066\u30c6\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\n\u3067\u3059\u304c\u3001\u3053\u306e\u3053\u3068\u306f\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3067\u6c42\u3081\u3089\u308c\u3066\u3044\u308b\u300c\u5931\u6557\u3059\u308b\u30c6\u30b9\u30c8\u3092\u66f8\u304f\u300d\u3053\u3068\u3068\u306f\u5c11\u3057\u610f\u5473\u5408\u3044\u306e\u9055\u3046\u3082\u306e\u3067\u3057\u305f\u3002<\/p>\n<p>\u6b63\u3057\u304f\u306f<\/p>\n<ul>\n<li>\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3092\u300c\u5b9f\u88c5\u3092\u3059\u308b\u524d\u306b\u300d\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u3001\u5b9f\u884c\u3059\u308b<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u88c5\u3059\u308b\u524d\u306b\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u5f53\u7136\u306e\u3053\u3068\u3067\u3059\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u306a\u3044\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u306b\u3064\u3044\u3066\u306e\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306a\u306e\u3067\u5931\u6557\u3057\u307e\u3059\u3002<br \/>\n\u3053\u308c\u304c\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u306e\u7b2c\u4e00\u6bb5\u968e\u3067\u3042\u308b\u300c\u5931\u6557\u3059\u308b\u30c6\u30b9\u30c8\u3092\u66f8\u304f\u300d\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u305f\u3081\u306b\u306f\u3001\u8981\u4ef6\u3092\u5341\u5206\u306b\u7406\u89e3\u3057\u305f\u4e0a\u3067\u5b9f\u88c5\u306b\u843d\u3068\u3057\u8fbc\u3080\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3064\u307e\u308a\u3001\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306f<strong>\u5b9f\u884c\u3067\u304d\u308b\u8a2d\u8a08<\/strong>\u3068\u8a00\u3044\u63db\u3048\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3092\u5b9f\u8df5\u3057\u3066\u307f\u305f<\/h2>\n<p>\u3053\u3053\u304b\u3089\u306f\u3001\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u306e\u624b\u6cd5\u306b\u5f93\u3063\u3066\u958b\u767a\u3092\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u3010\u958b\u767a\u74b0\u5883\u30fb\u4f7f\u7528\u8a00\u8a9e\u3011<br \/>\n\u30fbJava 1.8.0<br \/>\n\u30fbJUnit 5<br \/>\n\u30fbEclipse IDE<\/p>\n<h3>-------------\u3010\u5931\u6557\u3059\u308b\u30c6\u30b9\u30c8\u3092\u66f8\u304f\u3011-------------<\/h3>\n<p>\u524d\u8ff0\u3057\u305f\u5185\u5bb9\u3092\u5ff5\u982d\u306b\u3001\u5931\u6557\u3059\u308b\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u307e\u3059\u3002<br \/>\n\u307e\u305a\u306f\u5b9f\u88c5\u3057\u305f\u3044\u6a5f\u80fd\u3092\u8003\u3048\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u4eca\u56de\u4f5c\u308b\u3082\u306e\u306f\u4ee5\u4e0b\u306e\u8981\u4ef6\u3068\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u8981\u4ef6\uff1a\u91d1\u984d\u304c\u5165\u529b\u3055\u308c\u308b\u3068\u3001\u6d88\u8cbb\u7a0e\u304c\u8ab2\u7a0e\u3055\u308c\u305f\u91d1\u984d\u304c\u51fa\u529b\u3055\u308c\u308b\u3002<\/strong><\/p>\n<p>\u4e0a\u8a18\u306e\u8981\u4ef6\u306b\u5f93\u3044\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre>\nimport static org.junit.Assert.*;\nimport org.junit.Test;\n\npublic class CashTest {\n\n    @Test\n    public void testCalc() {\n        assertEquals(\"TEST FAILED\", 108, Cash.calculate(100));\n    }\n}\n<\/pre>\n<p>\u4e0a\u8a18\u306fCash.calculate()\u306e\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3067\u3059\u3002<br \/>\n\u5f15\u6570\u306b100\u3092\u6e21\u3057\u3001\u623b\u308a\u5024\u304c108\u3068\u306a\u308b\u3053\u3068\u3092\u691c\u8a3c\u3057\u307e\u3059\u3002<br \/>\n<small>\u3000\u203bassertEquals()\u306e\u7b2c\u4e00\u5f15\u6570\u306f\u5931\u6557\u6642\u306b\u51fa\u529b\u3055\u308c\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u3059\u3002<\/small><\/p>\n<p>\u3053\u306e\u3068\u304dCash.calculate()\u306f\u672a\u5b9f\u88c5\u306a\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u4eee\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre>\npublic class Cash {\n    public static int calculate(int num) {\n        return num;\n    }\n}\n<\/pre>\n<p>\u5165\u529b\u3055\u308c\u305f\u6570\u5b57\u3092\u305d\u306e\u307e\u307e\u8fd4\u3059\u3060\u3051\u306e\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3067\u3059\u3002<br \/>\n<small>\u3000\u203b\u91d1\u984d\u8a08\u7b97\u306b\u306f BigDecimal \u3092\u4f7f\u7528\u3059\u308b\u306e\u304c\u4e00\u822c\u7684\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u53ef\u8aad\u6027\u3092\u512a\u5148\u3057 int \u3067\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002<\/small><\/p>\n<p>\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3068\u305d\u308c\u306b\u5bfe\u3059\u308b\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306e\u30bb\u30c3\u30c8\u304c\u3067\u304d\u305f\u306e\u3067\u3001\u30c6\u30b9\u30c8\u3092\u5b9f\u65bd\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/JUnit1.png\" rel=\"facebox\" rel=\"attachment wp-att-20810\"><img loading=\"lazy\" src=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/JUnit1-300x52.png\" alt=\"\" width=\"700\" height=\"120\" class=\"alignnone size-medium wp-image-20810\" srcset=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/JUnit1-300x52.png 300w, https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/JUnit1-768x132.png 768w, https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/JUnit1-1024x176.png 1024w, https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/JUnit1.png 1143w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<p>Eclipse\u3067\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u4e0a\u8a18\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n\u3053\u3053\u3067\u6ce8\u76ee\u3057\u3066\u3044\u305f\u3060\u304d\u305f\u3044\u3053\u3068\u306f\u4ee5\u4e0b\u306e\u4e8c\u70b9\u3067\u3059\u3002<\/p>\n<ol>\n<li><strong>\u30c6\u30b9\u30c8\u304c\u5931\u6557\u3057\u3066\u3044\u308b\u3068\u3044\u3046\u3053\u3068<\/strong><br \/>\n\u3053\u306e\u6642\u70b9\u3067\u6210\u529f\u3057\u3066\u3044\u308b\u3068\u6b63\u3057\u304f\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u304c\u3067\u304d\u3066\u3044\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3082\u3057\u304f\u306f\u4eee\u306e\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u304c\u9593\u9055\u3048\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\n<\/li>\n<p><\/p>\n<li><strong>\u8d64\u3044\u30d0\u30fc\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u3068\u3044\u3046\u3053\u3068<\/strong><br \/>\nJUnit\u3092\u521d\u3081\u3068\u3059\u308b\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u5171\u901a\u3057\u3066\u898b\u3089\u308c\u308b\u30a8\u30e9\u30fc\u8868\u793a\u3067\u3059\u3002\u3053\u306e\u8272\u306b\u3061\u306a\u3093\u3067\u3001\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3067\u306f\u3053\u306e\u5de5\u7a0b\u306e\u3053\u3068\u3092<font color='red'><b>Red<\/b><\/font>\u3068\u8868\u73fe\u3057\u3066\u3044\u307e\u3059\u3002\n<\/li>\n<\/ol>\n<p>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u304c\u5931\u6557\u3057\u305f\u306e\u3067\u6b21\u306e\u5de5\u7a0b\u306b\u79fb\u308a\u307e\u3059\u3002<\/p>\n<h3>-------------\u3010\u30c6\u30b9\u30c8\u3092\u901a\u904e\u3059\u308b\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3011-------------<\/h3>\n<p>\u5931\u6557\u3059\u308b\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u5931\u6557\u3055\u305b\u305f\u5f8c\u306b\u306f\u3001\u305d\u306e\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u304c\u6210\u529f\u3059\u308b\u3088\u3046\u306b\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n\u3053\u3053\u3067\u306e\u30dd\u30a4\u30f3\u30c8\u306f<strong>\u3067\u304d\u308b\u9650\u308a\u3059\u3070\u3084\u304f\u4f5c\u6210\u3057\u3001\u6700\u5c0f\u9650\u306e\u5b9f\u88c5\u306b\u3059\u308b<\/strong>\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<br \/>\n\u3053\u306e\u8003\u3048\u65b9\u306f\u30c6\u30b9\u30c8\u30d5\u30a1\u30fc\u30b9\u30c8\u3068\u3044\u3046\u3088\u308a\u3082\u3001\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3082\u305d\u306e\u4e00\u7a2e\u3068\u3057\u3066\u542b\u307e\u308c\u308b\u30a2\u30b8\u30e3\u30a4\u30eb\u958b\u767a\u306e\u6027\u8cea\u3092\u53cd\u6620\u3057\u3066\u3044\u308b\u3082\u306e\u3067\u3059\u3002<br \/>\n\u3067\u304d\u308b\u3060\u3051\u5c0f\u3055\u306a\u5b9f\u88c5\u3092\u7e70\u308a\u8fd4\u3057\u3001\u78ba\u5b9f\u306b\u5b9f\u88c5\u3057\u3066\u3044\u304f\u3053\u3068\u3067\u7d50\u679c\u7684\u306b\u624b\u623b\u308a\u306e\u5c11\u306a\u3044\u958b\u767a\u306b\u306a\u308b\u3068\u3044\u3046\u52b9\u679c\u304c\u5b58\u5728\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001\u5148\u307b\u3069\u306e\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u304c\u5931\u6557\u3057\u305f\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002<br \/>\n\u3067\u304d\u308b\u3060\u3051\u65e9\u304f\u66f8\u304d\u5358\u7d14\u306a\u5b9f\u88c5\u3068\u306a\u308b\u3088\u3046\u306b\u5fc3\u304c\u3051\u307e\u3057\u305f\u3002<\/p>\n<pre>\npublic class Cash {\n    public static int calculate(int num) {\n        int fee = (int) (num * 1.08); \/\/\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306e\u305f\u3081\u5207\u308a\u6368\u3066\u3089\u308c\u308b\u5c0f\u6570\u306f\u8003\u616e\u3057\u306a\u3044\n        return fee;\n    }\n}\n<\/pre>\n<p>\u53d7\u3051\u53d6\u3063\u305f\u6570\u5024\u306b\u5bfe\u3057\u3066\u3001\u6d88\u8cbb\u7a0e\u306e8%\u3092\u8ab2\u7a0e\u3057\u3066\u8fd4\u3059\u3082\u306e\u3067\u3059\u3002<br \/>\n\u30dd\u30a4\u30f3\u30c8\u3068\u3057\u3066\u898b\u3066\u3044\u305f\u3060\u304d\u305f\u3044\u306e\u306f\u3001\u30af\u30e9\u30b9\u3084\u30e1\u30bd\u30c3\u30c9\u306e\u540d\u524d\u306f\u4e00\u5207\u5909\u3048\u3066\u3044\u306a\u3044\u70b9\u3067\u3059\u3002<br \/>\n\u3053\u3053\u304c\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3067\u3082\u30dd\u30a4\u30f3\u30c8\u3068\u306a\u3063\u3066\u3044\u3066\u3001\u4fee\u6b63\u524d\u5f8c\u3067\u540c\u3058\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u5fc5\u7136\u7684\u306b\u547c\u3073\u51fa\u3057\u3066\u3044\u308b\u540d\u524d\u3092\u5909\u3048\u3089\u308c\u306a\u3044\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/JUnit2.png\" rel=\"facebox\" rel=\"attachment wp-att-20835\"><img loading=\"lazy\" src=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/JUnit2-300x51.png\" alt=\"\" width=\"700\" height=\"120\" class=\"alignnone size-medium wp-image-20835\" srcset=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/JUnit2-300x51.png 300w, https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/JUnit2-1024x174.png 1024w, https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2018\/12\/JUnit2.png 1131w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<p>\u30a8\u30e9\u30fc\u304c\u51fa\u305a\u6210\u529f\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u3053\u306e\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306f\u5408\u683c\u3001\u3059\u306a\u308f\u3061\u5b9f\u88c5\u3057\u305f\u3044\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u304c\u6b63\u3057\u304f\u5b9f\u88c5\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\n\u3053\u306e\u3068\u304d\u3001\u5148\u307b\u3069\u306eRed\u3068\u306f\u7570\u306a\u308a\u7dd1\u8272\u306e\u30d0\u30fc\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u3053\u306e\u5de5\u7a0b\u306e\u3053\u3068\u3092\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3067\u306f<font color='green'><b>Green<\/b><\/font>\u3068\u8868\u73fe\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u672c\u6765\u306a\u3089\u3070\u3053\u306e\u5de5\u7a0b\u306e\u5f8c\u306b\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u65bd\u3057\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u5b9f\u88c5\u7b87\u6240\u304c\u5c11\u306a\u3044\u305f\u3081\u7701\u7565\u3057\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u4eca\u56de\u306f\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u306e\u5de5\u7a0b\u3068\u7c21\u5358\u306a\u4f8b\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<br \/>\n\u4f5c\u6210\u3057\u305f\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3068\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9<\/p>\n<pre>\nimport static org.junit.Assert.*;\nimport org.junit.Test;\n\npublic class CashTest {\n\n    @Test\n    public void testCalc() {\n        assertEquals(\"TEST FAILED\", 108, Cash.calculate(100));\n    }\n}\n<\/pre>\n<p>\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9<\/p>\n<pre>\npublic class Cash {\n    public static int calculate(int num) {\n        int fee = (int) (num * 1.08); \/\/\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306e\u305f\u3081\u5207\u308a\u6368\u3066\u3089\u308c\u308b\u5c0f\u6570\u306f\u8003\u616e\u3057\u306a\u3044\n        return fee;\n    }\n}\n<\/pre>\n<p>\u4eca\u56de\u306f\u4e00\u56de\u306e\u30b5\u30a4\u30af\u30eb\u3067\u3057\u305f\u304c\u3001\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u30d0\u30b0\u306e\u5c11\u306a\u3044\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u304c\u611f\u3058\u3066\u3044\u305f\u3060\u3051\u305f\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u5148\u306b\u66f8\u304f\u3053\u3068\u3067\u30b7\u30b9\u30c6\u30e0\u3078\u306e\u7406\u89e3\u304c\u6df1\u307e\u308b\u3001\u3068\u3044\u3046\u7279\u5fb4\u304c\u81ea\u5206\u306b\u5408\u3063\u3066\u3044\u308b\u3068\u611f\u3058\u3066\u3044\u307e\u3059\u3002<br \/>\n\u5927\u304d\u306a\u30b7\u30b9\u30c6\u30e0\u3067\u3042\u308b\u307b\u3069\u5927\u304d\u306a\u52b9\u679c\u304c\u5f97\u3089\u308c\u308b\u306e\u3067\u3001\u5b9f\u969b\u306e\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3067\u3082\u7a4d\u6975\u7684\u306b\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3092\u5b9f\u8df5\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u305d\u306e\u3068\u304d\u306b\u306f\u307e\u305f\u8a18\u4e8b\u306b\u3057\u307e\u3059\u306e\u3067\u3001\u3054\u4e00\u8aad\u3044\u305f\u3060\u3051\u308b\u3068\u5e78\u3044\u3067\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001\u8aad\u3093\u3067\u3044\u305f\u3060\u304d\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002<br \/>\nTECHSCORE BLOG\u521d\u53c2\u6226\u306e\u4e2d\u897f\u3067\u3059\u3002<br \/>\n\u3053\u308c\u306f\ud83d\ude3aTECHSCORE Advent Calendar 2018\ud83d\ude3a\u306e16\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2018\/12\/16\/drivendevelopment\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":80,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[308,18],"tags":[141],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/20228"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/80"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=20228"}],"version-history":[{"count":120,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/20228\/revisions"}],"predecessor-version":[{"id":21340,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/20228\/revisions\/21340"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=20228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=20228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=20228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}