{"id":646,"date":"2025-06-27T10:32:18","date_gmt":"2025-06-27T01:32:18","guid":{"rendered":"https:\/\/minna-systems.co.jp\/test\/?p=646"},"modified":"2025-11-04T10:31:28","modified_gmt":"2025-11-04T01:31:28","slug":"unit-testing-mocks-stubs-explained","status":"publish","type":"post","link":"https:\/\/minna-systems.co.jp\/test\/test-automation\/unit-testing-mocks-stubs-explained\/","title":{"rendered":"\u5358\u4f53\u30c6\u30b9\u30c8\u3092\u52b9\u7387\u5316\uff01\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u306e\u9055\u3044\u3068\u5b9f\u88c5\u30c6\u30af\u30cb\u30c3\u30af\u5b8c\u5168\u89e3\u8aac"},"content":{"rendered":"<h2>\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u3068\u306f\uff1f\u57fa\u672c\u6982\u5ff5\u3068\u4f7f\u3044\u5206\u3051\u30dd\u30a4\u30f3\u30c8<\/h2>\n<p>\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u958b\u767a\u306b\u304a\u3051\u308b\u5358\u4f53\u30c6\u30b9\u30c8\u3067\u306f\u3001\u30c6\u30b9\u30c8\u5bfe\u8c61\u306e\u30b3\u30fc\u30c9\u3092\u4ed6\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304b\u3089\u5206\u96e2\u3057\u3066\u30c6\u30b9\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u5206\u96e2\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306b\u3001\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u3068\u3044\u30462\u3064\u306e\u30c6\u30b9\u30c8\u30c0\u30d6\u30eb\u304c\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u306e\u57fa\u672c\u7684\u306a\u9055\u3044<\/h3>\n<p><a href=\"https:\/\/minna-systems.co.jp\/test\/test-automation\/test-automation-framework\/#index_id15\">\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6<\/a>\u306f\u3069\u3061\u3089\u3082\u30c6\u30b9\u30c8\u30c0\u30d6\u30eb\uff08\u672c\u7269\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4ee3\u308f\u308a\u306b\u4f7f\u7528\u3055\u308c\u308b\u4eee\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u3067\u3059\u304c\u3001\u76ee\u7684\u3068\u691c\u8a3c\u65b9\u6cd5\u304c\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><span class=\"swl-marker mark_yellow\">\u30b9\u30bf\u30d6\u306f\u300c\u72b6\u614b\u691c\u8a3c\u300d\u306e\u305f\u3081\u306e\u30c6\u30b9\u30c8\u30c0\u30d6\u30eb\u3067\u3001\u30c6\u30b9\u30c8\u5bfe\u8c61\u30b3\u30fc\u30c9\u306b\u7279\u5b9a\u306e\u5165\u529b\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u3092\u4e3b\u306a\u76ee\u7684\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/span>\u30b9\u30bf\u30d6\u306f\u5358\u7d14\u306b\u4e8b\u524d\u306b\u5b9a\u7fa9\u3055\u308c\u305f\u5fdc\u7b54\u3092\u8fd4\u3059\u3060\u3051\u3067\u3001\u547c\u3073\u51fa\u3055\u308c\u305f\u304b\u3069\u3046\u304b\u3092\u691c\u8a3c\u3059\u308b\u6a5f\u80fd\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4ee3\u308f\u308a\u306b\u30cf\u30fc\u30c9\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u8fd4\u3059\u30b9\u30bf\u30d6\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30c6\u30b9\u30c8\u306e\u5b9f\u884c\u901f\u5ea6\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4e00\u65b9\u3001<span class=\"swl-marker mark_yellow\">\u30e2\u30c3\u30af\u306f\u300c\u632f\u308b\u821e\u3044\u691c\u8a3c\u300d\u306e\u305f\u3081\u306e\u30c6\u30b9\u30c8\u30c0\u30d6\u30eb\u3067\u3001\u30c6\u30b9\u30c8\u5bfe\u8c61\u30b3\u30fc\u30c9\u304c\u4f9d\u5b58\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6b63\u3057\u304f\u64cd\u4f5c\u3057\u3066\u3044\u308b\u304b\u3092\u691c\u8a3c\u3057\u307e\u3059\u3002<\/span>\u30e2\u30c3\u30af\u306f\u30b9\u30bf\u30d6\u306e\u6a5f\u80fd\u306b\u52a0\u3048\u3066\u3001\u3069\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u4f55\u56de\u547c\u3073\u51fa\u3055\u308c\u305f\u304b\u3001\u3069\u306e\u3088\u3046\u306a\u5f15\u6570\u3067\u547c\u3073\u51fa\u3055\u308c\u305f\u304b\u306a\u3069\u3092\u8a18\u9332\u3057\u3001\u691c\u8a3c\u3059\u308b\u6a5f\u80fd\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u4f7f\u3044\u5206\u3051\u306e\u30dd\u30a4\u30f3\u30c8<\/h3>\n<p>\u4f7f\u3044\u5206\u3051\u306e\u57fa\u672c\u539f\u5247\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\uff1a<\/p>\n<p>1. \u300c\u7d50\u679c\u300d\u3092\u691c\u8a3c\u3057\u305f\u3044\u5834\u5408\u306f\u30b9\u30bf\u30d6\u3092\u4f7f\u7528\u3059\u308b<br \/>\n2. \u300c\u76f8\u4e92\u4f5c\u7528\u300d\u3092\u691c\u8a3c\u3057\u305f\u3044\u5834\u5408\u306f\u30e2\u30c3\u30af\u3092\u4f7f\u7528\u3059\u308b<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30e1\u30fc\u30eb\u30b5\u30fc\u30d3\u30b9\u3092\u547c\u3073\u51fa\u3059\u30b3\u30fc\u30c9\u3092\u30c6\u30b9\u30c8\u3059\u308b\u5834\u5408\u3001\u5b9f\u969b\u306b\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3055\u308c\u305f\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u305f\u3044\u306a\u3089\u30e2\u30c3\u30af\u3092\u4f7f\u7528\u3057\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u306e\u7d50\u679c\u306b\u3088\u3063\u3066\u51e6\u7406\u304c\u6b63\u3057\u304f\u5206\u5c90\u3057\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u305f\u3044\u306a\u3089\u30b9\u30bf\u30d6\u3092\u4f7f\u7528\u3059\u308b\u306e\u304c\u9069\u5207\u3067\u3059\u3002<\/p>\n<h2>\u5358\u4f53\u30c6\u30b9\u30c8\u306b\u304a\u3051\u308b\u30e2\u30c3\u30af\u30b9\u30bf\u30d6\u306e\u91cd\u8981\u6027\u3068\u5c0e\u5165\u30e1\u30ea\u30c3\u30c8<\/h2>\n<p>\u5358\u4f53\u30c6\u30b9\u30c8\u3067\u30e2\u30c3\u30af\u3084\u30b9\u30bf\u30d6\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u591a\u304f\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<h3>\u30c6\u30b9\u30c8\u306e\u5206\u96e2\u3068\u4fe1\u983c\u6027\u5411\u4e0a<\/h3>\n<p><span class=\"swl-marker mark_yellow\">\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30c6\u30b9\u30c8\u5bfe\u8c61\u306e\u30b3\u30fc\u30c9\u3092\u5916\u90e8\u4f9d\u5b58\u304b\u3089\u5b8c\u5168\u306b\u5206\u96e2\u3067\u304d\u307e\u3059\u3002<\/span>\u3053\u308c\u306b\u3088\u308a\u3001\u30c6\u30b9\u30c8\u304c\u5916\u90e8\u30b7\u30b9\u30c6\u30e0\u306e\u72b6\u614b\u306b\u5de6\u53f3\u3055\u308c\u308b\u3053\u3068\u306a\u304f\u3001\u5e38\u306b\u4e00\u8cab\u3057\u305f\u7d50\u679c\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3084API\u306e\u72b6\u614b\u306b\u95a2\u4fc2\u306a\u304f\u30c6\u30b9\u30c8\u304c\u5b9f\u884c\u3067\u304d\u308b\u305f\u3081\u3001\u30c6\u30b9\u30c8\u306e\u4fe1\u983c\u6027\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n<h3>\u958b\u767a\u30b9\u30d4\u30fc\u30c9\u306e\u5411\u4e0a<\/h3>\n<p>\u5b9f\u969b\u306e\u4f9d\u5b58\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304c\u307e\u3060\u958b\u767a\u4e2d\u3067\u3042\u3063\u3066\u3082\u3001\u30e2\u30c3\u30af\u3084\u30b9\u30bf\u30d6\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u30c6\u30b9\u30c8\u3092\u5148\u884c\u3057\u3066\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u4e26\u884c\u958b\u767a\u304c\u53ef\u80fd\u306b\u306a\u308a\u3001\u958b\u767a\u5168\u4f53\u306e\u30b9\u30d4\u30fc\u30c9\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30a8\u30c3\u30b8\u30b1\u30fc\u30b9\u306e\u30c6\u30b9\u30c8\u304c\u5bb9\u6613\u306b<\/h3>\n<p>\u5916\u90e8\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u518d\u73fe\u304c\u96e3\u3057\u3044\u30a8\u30e9\u30fc\u72b6\u614b\u3084\u7279\u6b8a\u306a\u30ec\u30b9\u30dd\u30f3\u30b9\u3082\u3001\u30e2\u30c3\u30af\u3084\u30b9\u30bf\u30d6\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u7c21\u5358\u306b\u518d\u73fe\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3084\u30b5\u30fc\u30d0\u30fc\u30a8\u30e9\u30fc\u306a\u3069\u306e\u4f8b\u5916\u7684\u306a\u72b6\u6cc1\u3092\u30b7\u30df\u30e5\u30ec\u30fc\u30c8\u3057\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5805\u7262\u6027\u3092\u30c6\u30b9\u30c8\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u30c6\u30b9\u30c8\u5b9f\u884c\u306e\u9ad8\u901f\u5316<\/h3>\n<p>\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30a2\u30af\u30bb\u30b9\u3084\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901a\u4fe1\u306f\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u304c\u3001\u30e2\u30c3\u30af\u3084\u30b9\u30bf\u30d6\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3053\u308c\u3089\u306e\u51e6\u7406\u3092\u7701\u7565\u3067\u304d\u308b\u305f\u3081\u3001\u30c6\u30b9\u30c8\u306e\u5b9f\u884c\u6642\u9593\u304c\u5927\u5e45\u306b\u77ed\u7e2e\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u958b\u767a\u8005\u306f\u983b\u7e41\u306b\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u554f\u984c\u306e\u65e9\u671f\u767a\u898b\u306b\u3064\u306a\u304c\u308a\u307e\u3059\u3002<\/p>\n<h2>\u5b9f\u8df5\uff01Java\u3067\u306e\u30e2\u30c3\u30af\u30b9\u30bf\u30d6\u5b9f\u88c5\u30c6\u30af\u30cb\u30c3\u30af<\/h2>\n<p>Java\u3067\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u304c\u3001\u6700\u3082\u4e00\u822c\u7684\u306a\u306e\u306fMockito\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<h3>Mockito\u3092\u4f7f\u3063\u305f\u30e2\u30c3\u30af\u5b9f\u88c5<\/h3>\n<p>&#8220;`java<br \/>\n@Test<br \/>\npublic void testUserService() {<br \/>\n\/\/ \u30e2\u30c3\u30af\u306e\u4f5c\u6210<br \/>\nUserRepository mockRepository = mock(UserRepository.class);<\/p>\n<p>\/\/ \u30e2\u30c3\u30af\u306e\u632f\u308b\u821e\u3044\u3092\u5b9a\u7fa9<br \/>\nwhen(mockRepository.findById(1L)).thenReturn(new User(1L, &#8220;\u30c6\u30b9\u30c8\u30e6\u30fc\u30b6\u30fc&#8221;));<\/p>\n<p>\/\/ \u30c6\u30b9\u30c8\u5bfe\u8c61\u306e\u30b5\u30fc\u30d3\u30b9\u306b\u30e2\u30c3\u30af\u3092\u6ce8\u5165<br \/>\nUserService userService = new UserService(mockRepository);<\/p>\n<p>\/\/ \u30c6\u30b9\u30c8\u5b9f\u884c<br \/>\nUser user = userService.getUserById(1L);<\/p>\n<p>\/\/ \u7d50\u679c\u306e\u691c\u8a3c<br \/>\nassertEquals(&#8220;\u30c6\u30b9\u30c8\u30e6\u30fc\u30b6\u30fc&#8221;, user.getName());<\/p>\n<p>\/\/ \u547c\u3073\u51fa\u3057\u306e\u691c\u8a3c<br \/>\nverify(mockRepository).findById(1L);<br \/>\n}<br \/>\n&#8220;`<br \/>\n<span class=\"swl-marker mark_yellow\">\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001UserRepository\u306e\u30e2\u30c3\u30af\u3092\u4f5c\u6210\u3057\u3001findById\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u3068\u304d\u306b\u7279\u5b9a\u306eUser\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u3059\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/span>\u305d\u306e\u5f8c\u3001verify\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001findById\u30e1\u30bd\u30c3\u30c9\u304c\u6b63\u78ba\u306b1\u56de\u547c\u3073\u51fa\u3055\u308c\u305f\u3053\u3068\u3092\u691c\u8a3c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30b9\u30bf\u30d6\u306e\u5b9f\u88c5\u4f8b<\/h3>\n<p>&#8220;`java<br \/>\n@Test<br \/>\npublic void testUserServiceWithStub() {<br \/>\n\/\/ \u30b9\u30bf\u30d6\u306e\u4f5c\u6210<br \/>\nUserRepository stubRepository = new StubUserRepository();<\/p>\n<p>\/\/ \u30c6\u30b9\u30c8\u5bfe\u8c61\u306e\u30b5\u30fc\u30d3\u30b9\u306b\u30b9\u30bf\u30d6\u3092\u6ce8\u5165<br \/>\nUserService userService = new UserService(stubRepository);<\/p>\n<p>\/\/ \u30c6\u30b9\u30c8\u5b9f\u884c<br \/>\nUser user = userService.getUserById(1L);<\/p>\n<p>\/\/ \u7d50\u679c\u306e\u691c\u8a3c<br \/>\nassertEquals(&#8220;\u30c6\u30b9\u30c8\u30e6\u30fc\u30b6\u30fc&#8221;, user.getName());<br \/>\n}<\/p>\n<p>\/\/ \u30b9\u30bf\u30d6\u30af\u30e9\u30b9\u306e\u5b9f\u88c5<br \/>\nclass StubUserRepository implements UserRepository {<br \/>\n@Override<br \/>\npublic User findById(Long id) {<br \/>\nreturn new User(1L, &#8220;\u30c6\u30b9\u30c8\u30e6\u30fc\u30b6\u30fc&#8221;);<br \/>\n}<\/p>\n<p>\/\/ \u305d\u306e\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u5b9f\u88c5<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001UserRepository\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30b9\u30bf\u30d6\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3001findById\u30e1\u30bd\u30c3\u30c9\u304c\u5e38\u306b\u7279\u5b9a\u306eUser\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u3059\u3088\u3046\u306b\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30e2\u30c3\u30af\u30b9\u30bf\u30d6\u3092\u6d3b\u7528\u3057\u305f\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a(TDD)\u306e\u9032\u3081\u65b9<\/h2>\n<p>\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\uff08TDD\uff09\u3067\u306f\u3001\u300c\u30c6\u30b9\u30c8\u2192\u5b9f\u88c5\u2192\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u300d\u306e\u30b5\u30a4\u30af\u30eb\u3092\u7e70\u308a\u8fd4\u3057\u307e\u3059\u304c\u3001\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u306f\u3053\u306e\u30d7\u30ed\u30bb\u30b9\u3092\u52b9\u7387\u5316\u3059\u308b\u91cd\u8981\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<h3>TDD\u30b5\u30a4\u30af\u30eb\u3068\u30e2\u30c3\u30af\u30b9\u30bf\u30d6\u306e\u7d71\u5408<\/h3>\n<p>1. <strong>\u30c6\u30b9\u30c8\u4f5c\u6210\u30d5\u30a7\u30fc\u30ba<\/strong>\uff1a\u307e\u305a\u3001\u5fc5\u8981\u306a\u6a5f\u80fd\u306e\u30c6\u30b9\u30c8\u3092\u66f8\u304d\u307e\u3059\u3002\u3053\u306e\u6bb5\u968e\u3067\u3001\u4f9d\u5b58\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30e2\u30c3\u30af\u3084\u30b9\u30bf\u30d6\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<p>2. <strong>\u5b9f\u88c5\u30d5\u30a7\u30fc\u30ba<\/strong>\uff1a\u30c6\u30b9\u30c8\u3092\u901a\u904e\u3055\u305b\u308b\u305f\u3081\u306b\u6700\u5c0f\u9650\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002\u30e2\u30c3\u30af\u3084\u30b9\u30bf\u30d6\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u307e\u3060\u5b9f\u88c5\u3055\u308c\u3066\u3044\u306a\u3044\u4f9d\u5b58\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304c\u3042\u3063\u3066\u3082\u958b\u767a\u3092\u9032\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>3. <strong>\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u30d5\u30a7\u30fc\u30ba<\/strong>\uff1a\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3092\u6539\u5584\u3057\u3064\u3064\u3001\u30c6\u30b9\u30c8\u304c\u5f15\u304d\u7d9a\u304d\u901a\u904e\u3059\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<br \/>\n<span class=\"swl-marker mark_yellow\">TDD\u3067\u306f\u3001\u30e2\u30c3\u30af\u3092\u4f7f\u3063\u3066\u300c\u3069\u306e\u3088\u3046\u306b\u4ed6\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3068\u76f8\u4e92\u4f5c\u7528\u3059\u308b\u304b\u300d\u3092\u5148\u306b\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3067\u3001\u660e\u78ba\u306a\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u8a2d\u8a08\u304c\u4fc3\u9032\u3055\u308c\u307e\u3059\u3002<\/span>\u3053\u308c\u306b\u3088\u308a\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u9593\u306e\u7d50\u5408\u5ea6\u304c\u4f4e\u304f\u3001\u51dd\u96c6\u5ea6\u306e\u9ad8\u3044\u8a2d\u8a08\u304c\u81ea\u7136\u3068\u751f\u307e\u308c\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u3088\u304f\u3042\u308b\u30e2\u30c3\u30af\u30b9\u30bf\u30d6\u5b9f\u88c5\u306e\u5931\u6557\u30d1\u30bf\u30fc\u30f3\u3068\u56de\u907f\u7b56<\/h2>\n<p>\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u306f\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u304c\u3001\u8aa4\u3063\u305f\u4f7f\u3044\u65b9\u3092\u3059\u308b\u3068\u554f\u984c\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u904e\u5270\u306a\u30e2\u30c3\u30af\u5316<\/h3>\n<p>\u3059\u3079\u3066\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u30e2\u30c3\u30af\u5316\u3059\u308b\u3068\u3001\u30c6\u30b9\u30c8\u304c\u5b9f\u88c5\u306e\u8a73\u7d30\u306b\u904e\u5ea6\u306b\u7d50\u3073\u3064\u304d\u3001\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u304c\u96e3\u3057\u304f\u306a\u308a\u307e\u3059\u3002<br \/>\n<strong>\u56de\u907f\u7b56<\/strong>: <span class=\"swl-marker mark_yellow\">\u5fc5\u8981\u6700\u5c0f\u9650\u306e\u30e2\u30c3\u30af\u5316\u3092\u5fc3\u304c\u3051\u3001\u5b9f\u969b\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f7f\u7528\u3067\u304d\u308b\u5834\u5408\u306f\u305d\u3061\u3089\u3092\u512a\u5148\u3057\u307e\u3057\u3087\u3046\u3002<\/span>\u7279\u306b\u3001\u5024\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u306a\u3069\u306e\u5358\u7d14\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u30e2\u30c3\u30af\u5316\u305b\u305a\u3001\u5b9f\u969b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f7f\u7528\u3059\u308b\u306e\u304c\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<h3>\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u306e\u6df7\u540c<\/h3>\n<p>\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u306e\u9055\u3044\u3092\u7406\u89e3\u305b\u305a\u306b\u4f7f\u7528\u3059\u308b\u3068\u3001\u30c6\u30b9\u30c8\u306e\u610f\u56f3\u304c\u4e0d\u660e\u78ba\u306b\u306a\u308a\u3001\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u304c\u56f0\u96e3\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n<strong>\u56de\u907f\u7b56<\/strong>: \u30c6\u30b9\u30c8\u306e\u76ee\u7684\u3092\u660e\u78ba\u306b\u3057\u3001\u72b6\u614b\u3092\u691c\u8a3c\u3057\u305f\u3044\u5834\u5408\u306f\u30b9\u30bf\u30d6\u3092\u3001\u632f\u308b\u821e\u3044\u3092\u691c\u8a3c\u3057\u305f\u3044\u5834\u5408\u306f\u30e2\u30c3\u30af\u3092\u4f7f\u7528\u3059\u308b\u3068\u3044\u3046\u30eb\u30fc\u30eb\u3092\u5b88\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u8106\u5f31\u306a\u30c6\u30b9\u30c8<\/h3>\n<p>\u5b9f\u88c5\u306e\u8a73\u7d30\u306b\u904e\u5ea6\u306b\u4f9d\u5b58\u3057\u305f\u30c6\u30b9\u30c8\u306f\u3001\u5c0f\u3055\u306a\u30b3\u30fc\u30c9\u5909\u66f4\u3067\u3082\u5931\u6557\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u30b3\u30b9\u30c8\u304c\u9ad8\u304f\u306a\u308a\u307e\u3059\u3002<br \/>\n<strong>\u56de\u907f\u7b56<\/strong>: <span class=\"swl-marker mark_yellow\">\u516c\u958b\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u5bfe\u3057\u3066\u30c6\u30b9\u30c8\u3092\u884c\u3044\u3001\u5185\u90e8\u5b9f\u88c5\u306e\u8a73\u7d30\u306b\u306f\u3042\u307e\u308a\u4f9d\u5b58\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/span>\u307e\u305f\u3001\u30e2\u30c3\u30af\u306e\u691c\u8a3c\u306f\u5fc5\u8981\u6700\u5c0f\u9650\u306b\u7559\u3081\u3001\u904e\u5ea6\u306b\u53b3\u5bc6\u306a\u691c\u8a3c\u306f\u907f\u3051\u308b\u3079\u304d\u3067\u3059\u3002<\/p>\n<h2>\u30af\u30e9\u30a6\u30c9\u74b0\u5883\u3067\u306e\u30e2\u30c3\u30af\u30b9\u30bf\u30d6\u6d3b\u7528\u8853\u3068\u6700\u65b0\u30c4\u30fc\u30eb\u7d39\u4ecb<\/h2>\n<p>\u30af\u30e9\u30a6\u30c9\u30d9\u30fc\u30b9\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3067\u306f\u3001\u5916\u90e8\u30b5\u30fc\u30d3\u30b9\u3068\u306e\u9023\u643a\u304c\u591a\u304f\u306a\u308b\u305f\u3081\u3001\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u306e\u91cd\u8981\u6027\u304c\u3055\u3089\u306b\u9ad8\u307e\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30af\u30e9\u30a6\u30c9\u30b5\u30fc\u30d3\u30b9\u306e\u30e2\u30c3\u30af\u5316<\/h3>\n<p>AWS\u3001Google Cloud\u3001Azure\u306a\u3069\u306e\u30af\u30e9\u30a6\u30c9\u30b5\u30fc\u30d3\u30b9\u3092\u5229\u7528\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u30c6\u30b9\u30c8\u3059\u308b\u5834\u5408\u3001\u5b9f\u969b\u306e\u30af\u30e9\u30a6\u30c9\u30ea\u30bd\u30fc\u30b9\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30b3\u30b9\u30c8\u304c\u304b\u304b\u308b\u4e0a\u306b\u30c6\u30b9\u30c8\u306e\u518d\u73fe\u6027\u304c\u4f4e\u4e0b\u3057\u307e\u3059\u3002<br \/>\n<strong>\u89e3\u6c7a\u7b56<\/strong>: <span class=\"swl-marker mark_yellow\">LocalStack\uff08AWS API\u306e\u30ed\u30fc\u30ab\u30eb\u30a8\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\uff09\u3084Azurite\uff08Azure Storage\u306e\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u30fc\uff09\u306a\u3069\u306e\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3001\u30af\u30e9\u30a6\u30c9\u30b5\u30fc\u30d3\u30b9\u3092\u30ed\u30fc\u30ab\u30eb\u3067\u6a21\u5023\u3067\u304d\u307e\u3059\u3002<\/span>\u3053\u308c\u306b\u3088\u308a\u3001\u5b9f\u969b\u306e\u30af\u30e9\u30a6\u30c9\u30ea\u30bd\u30fc\u30b9\u3092\u4f7f\u7528\u305b\u305a\u306b\u30c6\u30b9\u30c8\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u6700\u65b0\u306e\u30e2\u30c3\u30af\u30b9\u30bf\u30d6\u30c4\u30fc\u30eb<\/h3>\n<p>1. <strong>WireMock<\/strong>: HTTP\u30d9\u30fc\u30b9\u306eAPI\u3092\u30e2\u30c3\u30af\u5316\u3059\u308b\u305f\u3081\u306e\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3001REST API\u3084\u30de\u30a4\u30af\u30ed\u30b5\u30fc\u30d3\u30b9\u306e\u30c6\u30b9\u30c8\u306b\u6700\u9069\u3067\u3059\u3002<\/p>\n<p>2. <strong>Testcontainers<\/strong>: Docker\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3084\u305d\u306e\u4ed6\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u8d77\u52d5\u3057\u3001\u7d71\u5408\u30c6\u30b9\u30c8\u3092\u884c\u3046\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\u30e2\u30c3\u30af\u3088\u308a\u3082\u5b9f\u969b\u306e\u74b0\u5883\u306b\u8fd1\u3044\u30c6\u30b9\u30c8\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>3. <strong>MockK<\/strong>: Kotlin\u5411\u3051\u306e\u30e2\u30c3\u30af\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3001\u30b3\u30eb\u30fc\u30c1\u30f3\u306a\u3069Kotlin\u56fa\u6709\u306e\u6a5f\u80fd\u3082\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>4. <strong>Mountebank<\/strong>: \u5206\u6563\u30b7\u30b9\u30c6\u30e0\u306e\u30c6\u30b9\u30c8\u7528\u306e\u30e2\u30c3\u30af\u30b5\u30fc\u30d0\u30fc\u3067\u3001\u8907\u6570\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u30c4\u30fc\u30eb\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u8907\u96d1\u306a\u30af\u30e9\u30a6\u30c9\u74b0\u5883\u3067\u3082\u52b9\u7387\u7684\u306a\u30c6\u30b9\u30c8\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u3092\u9069\u5207\u306b\u4f7f\u3044\u5206\u3051\u3001\u30c6\u30b9\u30c8\u6226\u7565\u306b\u7d44\u307f\u8fbc\u3080\u3053\u3068\u3067\u3001\u54c1\u8cea\u306e\u9ad8\u3044\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u52b9\u7387\u7684\u306b\u958b\u767a\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u3068\u306f\uff1f\u57fa\u672c\u6982\u5ff5\u3068\u4f7f\u3044\u5206\u3051\u30dd\u30a4\u30f3\u30c8 \u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u958b\u767a\u306b\u304a\u3051\u308b\u5358\u4f53\u30c6\u30b9\u30c8\u3067\u306f\u3001\u30c6\u30b9\u30c8\u5bfe\u8c61\u306e\u30b3\u30fc\u30c9\u3092\u4ed6\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304b\u3089\u5206\u96e2\u3057\u3066\u30c6\u30b9\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u5206\u96e2\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306b\u3001\u30e2\u30c3\u30af\u3068\u30b9\u30bf\u30d6\u3068\u3044\u30462\u3064\u306e\u30c6\u30b9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":125,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"swell_btn_cv_data":"","footnotes":""},"categories":[72,69],"tags":[148,149,29,147,33],"class_list":["post-646","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-testing-technology","category-test-automation","tag-148","tag-149","tag-29","tag-147","tag-33"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/minna-systems.co.jp\/test\/wp-json\/wp\/v2\/posts\/646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/minna-systems.co.jp\/test\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/minna-systems.co.jp\/test\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/minna-systems.co.jp\/test\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/minna-systems.co.jp\/test\/wp-json\/wp\/v2\/comments?post=646"}],"version-history":[{"count":2,"href":"https:\/\/minna-systems.co.jp\/test\/wp-json\/wp\/v2\/posts\/646\/revisions"}],"predecessor-version":[{"id":1116,"href":"https:\/\/minna-systems.co.jp\/test\/wp-json\/wp\/v2\/posts\/646\/revisions\/1116"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/minna-systems.co.jp\/test\/wp-json\/wp\/v2\/media\/125"}],"wp:attachment":[{"href":"https:\/\/minna-systems.co.jp\/test\/wp-json\/wp\/v2\/media?parent=646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/minna-systems.co.jp\/test\/wp-json\/wp\/v2\/categories?post=646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/minna-systems.co.jp\/test\/wp-json\/wp\/v2\/tags?post=646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}