質ã¨ã¹ãã¼ãï¼2020æ¥çï¼ 2020/02/13 @ ãããµã2020
The longer I spend as a software engineer, the more obsessive I get about testing. I fully subscribe to the definition of legacy code as âcode without an automated test suite.â Iâm convinced that the best thing you can do to encourage fast progress in a test suite is to design for testing and have a fast, reliable, comprehensive test suite. But for all that, Iâve never really subscribed to any of
JAWS Festa æ±æµ·é 2016
package main import ( "net/http" "github.com/facebookgo/grace/gracehttp" "github.com/sebest/xff" "goji.io" "goji.io/pat" "golang.org/x/net/context" ) func main() { mux := goji.NewMux() mux.HandleC(pat.New("/*"), NewMux()) err := gracehttp.Serve(&http.Server{Addr: ":8080", Handler: mux}) if err != nil { panic(err) } } func NewMux() *goji.Mux { mux := goji.NewMux() mux.Use(xff.Handler) mux.HandleFun
golangã§IOã¸ã®ãã¹ããè¡ã | ãããã®ç©ç½® ã¾ã¨ã fmt.Printçã«ã¡ããã¨åºåãããããã¹ãããã çµè«ã¨ãã¦ã¯ç´æ¥ã¯ç¡ç io.Writerãå©ç¨ããããã«å¤ãããã¨ã§ç°¡åã«ãã¹ãå¯è½ 渡ãããio.Writerã«æ¸ãè¾¼ãããã«ãã ... http://ota42y.com/blog/2015/04/01/go-io-test/ golang ã«ã¯ Example Test ã¨ããæ©è½ãããããã¹ãé¢æ°åã« Example ã®ãã¬ãã£ãã¯ã¹ãä»ããäºã§å®è¡çµæã¨ãã¦åºåãããæ¨æºåºåã®ãã¹ããè¡ãäºãåºæ¥ã¾ãã æå¾ ããçµæã¯ãã®é¢æ°ã®ä¸ã«ã³ã¡ã³ãã¨ãã¦æ¸ããã¨ãåºæ¥ã¾ãã go-pipeline/example_test.go at master - mattn/go-pipeline-· GitHub https://github.com/mattn/go-pip
æ¬çªç°å¢ã§åãã¦ããFluentdã®in_forwardã«ä½ãæµãã¦ããã®ããç¥ãããããã©è¨å®ã触ããããªãâ¦ã¿ãããªå ´åã«æµãã¦ããã¿ã°ãã¬ã³ã¼ããè¦ãæ¹æ³ã§ããç¹ã«Fluentdã«éã£ã話ã§ã¯ãªãã§ãããåå¿é²ã¨ãã¦æ¸ãã¦ããã¾ãã 1. tcpdumpã§ãã£ãã㣠調ã¹ãããµã¼ãä¸ã§ãtcpdumpã使ã£ã¦ãã±ãããã£ããã£ãåãã¾ããin_forwardã®ãã¼ãçªå·ãªã©ãæå®ãã¦ãã£ããã£ãã¾ãã $ sudo tcpdump -i eth0 -w fluentd.pcap port 24224 and tcp 2. tcptraceã§TCPã¹ããªã¼ã ã®ãã¼ã¿ã ãåãåºã tcptraceã¯-eãªãã·ã§ã³ã渡ãã¨ãTCPã¹ããªã¼ã ãã¨ã®ãã¼ã¿ããã¡ã¤ã«ã«åãã¦ãããã®ã§ãããå©ç¨ãã¾ãããªããtcptraceã¯Homebrewãaptã§å ¥ãã¨æãã¾ãã $ tcptrace -e
ã¯ããã« å æ¥éå¬ããããéçºãæ´»æ§åããããã®ãã¤ã³ãã¨ãã¹ãã«é¢ããåå¼·ä¼ãã«ã¦ããçµç¹ã«ãã¹ããæ¸ãæåãæ ¹ä»ãããæ¦ç¥ã¨æ¦è¡ãã®ã話ãèãã¦ããã®ã§ãããã§ã®å 容ã¨èªåãæå±ãã¦ããçµç¹ã¸ã®é©ç¨ã«ã¤ãã¦è¨ãã¦ã¿ã¾ãã å種è³æ çºè¡¨è³æ çµç¹ã«ãã¹ããæ¸ãæåãæ ¹ä»ãããæ¦ç¥ã¨æ¦è¡ from Takuto Wada Togetter togetter.com ææ³ è¡æçã ã£ãã®ã¯ãããã¹ããæ¸ãæåã®é¸æã«ã¯2å¹´ãããããããã¨ããè¨èã t_wadaãæåã®é¸æã¯å¹´åä½ã®äºæ¥ã«ãªããã ããã2å¹´ãããããããã #jopfâ ã¿ãã²ã§ããªã·ã£ã¬ç·åã«ãªããã (@miyohide) 2016, 2æ 16 ä¸æ¥äºæ¥ã§ã§ããã¨ã¯æã£ã¦ããªããã§ãããã¾ããå¹´åä½ã¨ã¯ã ãã®ãããå¢ãã§ä¹ããããã»ã©çãã¯ãªããæ¦ç¥ã¨æ¦è¡ã§ãã£ã¦ãã¹ããæ¸ãæåãé¸æãã¾ãããã¨ãã話ã«ç¶ãã¾ãã
http://github.com/ToQoz/gopwt goã®power assertç¨ããã±ã¼ã¸ãã ãããã§ãã https://t.co/pzRuhoHVC5â ãã¨ã¡ããã§ã (@ToQoz) July 14, 2014 ãã®æã¯ããAssertå ã§å¯ä½ç¨ã®ããé¢æ°ãå¼ãã§ããã¨ãããã³ã±ãå ´åã«ãåºåã®æã«å度å¼ã°ãã¦å®éã®å¤ã¨éããã®ã表示ããããããã以éã®ãã¹ãã«å½±é¿ããããã¿ãããªåé¡ããã£ããããã解決ããã«ã¯é©å½ã«é¢æ°ã®å¼ã³åºãããã£ãã·ã¥ãã¦ããå¿ è¦ããã£ã¦ãåã®ãã§ãã¯ãå®è¡æã«ãããªãè¨èªãªããa() == b() ã¨ãã£ã¦ã®ã memorized(a) == memorized(b) ã¨ãã£ã¦ã§ããã¨æããã©ããããã大å¤ã ã£ãã reflect.ValueOf(f).Call(reflect.ValueOf(arg1), reflect.ValueOf(a
ï¼è¿½è¨: ãã®ããã¯ã¯ã©ã¤ãã©ãªã¨ãã¦ç¬ç«ããã¾ãã gfx/RobolectricInstrumentation · GitHubï¼ Robolectricã¯ä¾¿å©ã§ãããOracle JREã¨Android Runtimeã®å¾®å¦ãªæåã®éããç¹ã«Android Runtimeã«ãã°ã®åé¿ãããããªã³ã¼ãã®ãã¹ããã§ããªãã¨ããåé¡ãããã¾ãã ã¨ããã§Robolectricãç´ç²ã«JVMç¨ã®Android Frameworkã©ã³ã¿ã¤ã ã¨ã¿ãªãã¨ããã¹ãã¯ã©ã¹ãã»ã¨ãã©Android Instrumentation Testsã¨åãããã«æ¸ããã¨ãã§ãã¾ãã Robolectricã®ã»ãããã¹ãã®å®è¡ãéãã®ã§ãéçºä¸ã¯Robolectricã使ãã»ããå¹çã¯ããã®ã§ãããå¾®å¦ã«æåã«éããããã®ã§å®æ©ã§ããã¹ãã¯èµ°ããããã¨ããã§ããããã§åããã¹ãã¯ã©ã¹ãAndroid Instrum
Serverspec ã® Docker Backend ã使ã£ã Docker ã³ã³ããã®ãã¹ãã CircleCI ä¸ã§å®è¡ããéãå¤å°æããã£ãã®ã§ããã®è©¦è¡é¯èª¤ã«ãã£ã¦ã§ããããµã³ãã«ããã¸ã§ã¯ããå ¬éãã¾ããã GitHub Repository quay.io Registry CircleCI Builds ååã®è¨äºã§ç´¹ä»ããäºä¾ã¯ Rails ãæ¡ç¨ãã¦ããã®ã§ãã³ã³ããå´ã«ã Ruby ãã¤ã³ã¹ãã¼ã«ããã¦ãããã³ã³ããå´ã«ãã¦ã³ãããã ã㧠Serverspec ãå®è¡ã§ãã¾ããã docker run \ -e DATABASE_URL="${DATABASE_URL}" \ -e REDIS_URL="${REDIS_URL}" \ -v "$(pwd)/docker/serverspec"\:/mnt/serverspec \ --name "serverspec
Javaã§ã®ãã¹ãã¯JUnit4ã使ããã¦ããã¨æãã¾ãããèªåã¨ãã¦ã¯ãããã«å ãã¦AssertJããªã¹ã¹ã¡ãã¾ãã AssertJ AssertJã使ããããçç± JUnit4ã®assertThatã¨æ¯ã¹ã¦AssertJã使ããããçç±ã¯2ã¤ããã¾ãã æµãããããªã¤ã³ã¿ã¼ãã§ã¼ã¹ AssertJã¯ãFluent assertions for javaãã¨ããããã¼ã¸ã«å¤§ããæ¸ããã¦ããããã«ãæµãããããªã¤ã³ã¿ã¼ãã§ã¼ã¹ãæ大ã®ç¹å¾´ã§ãããã¡ãã¡ããã¥ã¡ã³ãã調ã¹ãªãã¦ããIDEã®è£å®æ©è½ã§é©åãªã¡ã½ããã調ã¹ãããã®ã§ãJUnit4ã®assertThatã«æ¯ã¹ã¦æ¸ããããã§ãã æ¡å¼µãMatcherã«æ¯ã¹ã¦é¥ãã«æ¥½ Matcherã®æ¡å¼µå¯¾è±¡ã¯ãæ¯è¼æ¹æ³ãã§ãAssertJã®æ¡å¼µå¯¾è±¡ã¯ãã¯ã©ã¹ããªã®ã§æ¯è¼ããã®ã¯é©åã§ã¯ãªãããããã¾ããããMatcherã®æ¡å¼µãé´ã®ä¸ãã足ãæ»ãæ
Perl æ¸ãã¦ãã Test::More ã§ãã¹ãæ¸ãã¾ããã¨æãã®ã§ãããTest::More ã£ã¦ããããã¾ãå¥ã« Test::More ã ããããã¨ããããã§ããªãã®ã§ããããã¹ããããã¨ãã®ã±ã¢ãååãããªããªã¨æãã¨ãããã£ããããã¾ãã éçºéç¨ã§æ¸ãã¦ãã³ã¼ãã¨ããã®ã¯ããã¤ããã¤ã確信ãæã£ã¦æ¸ãã¦ããããã§ã¯ãªãããã§ãããã§ãªãã¦ããã£ããééãã¨ããããããã£ãããã¹ãæ¸ãã¦ããã®ã«ä½ã ãããããããªãçç±ã§ããã¦ãã¹ã§ããªãã¦æéã浪費ãã¦ãã¾ã£ãããæ¥å¸¸ã«ãªã£ã¦ãããã¾ãããï¼ ããããã®ãç¹°ãè¿ãã¦ããã¨ããã¦ãã¹ãå«ãã«ãªããã¹ãæ¸ããªããªã£ã¦æ¬çªã³ã¼ãã«ãããã°ã³ã¼ããå ¥ãä¹±ãããªãã¡ã¯ã¿ãã©ãã©ãä¸å¯è½ã«ãªã£ã¦å°åãå¹ããªãã¾ã¾ããã¸ã§ã¯ãã失æãã¦å½¼å¥³ã«æ¯ããã¦ãã¾ãããã§ãããå°ãã¾ãã note diag explain Test::More ã«ã¯
JUnit4.12ãã§ã¾ããï¼â¦â¦2014/12/4ã«ããªãã¨6ã¶æçµã£ã¦ããã¾ããããã JUnit 4.12ã®æ°æ©è½ç´¹ä»ã¾ã¨ã / ãããçµ(2014/8/5) JUnit 4.12ããå ¥ã£ãTestRuleã軽ãè¦ã¦ã¿ã / è£ç´(2015/2/28) JUnit4.12æ代ã®Parameterized Test / mike-neckã®ããã°(2015/5/6) ã°ã°ã£ã¦ã4.12ã®æ å ±ããã¾ãå¼ã£ããããªãã£ãã®ã§æ¸ãã¦ã¿ã¾ããã ãªãªã¼ã¹ãã¼ãæãèªã¿ ã¨ãã¾ãSummary of changes in version 4.12 ãæãèªã¿è´ãã¦ãæ°ã«ãªãã¨ããï¼â ï¼ã¯å¾ã§ããå°ã詳ããæ¸ãäºã«ãã¾ãããªãããã°ãã£ãã¯ã¹ãã¡ãã»ã¼ã¸å¤æ´ãæåã®çµ±åãªã©ã®ç¹ã«ãã¹ãã³ã¼ãã£ã³ã°ã«å½±é¿ãä¸ããªããã®ã¯ã¹ã«ã¼ã Assersions floatã®assertNotEquals â
ããã«ã¡ã¯ãæè¡é¨ã®æ¾å°¾(@Kazu_cocoa)ã§ãã å®å®ãããªãªã¼ã¹ãç¶ç¶ãã¦åãçºã«ã¯ãéçºããã»ã¹ãå®è£ ã大äºã§ããããã®ä¸ã§ã©ã®ãããªç¢ºèªããã¹ããç¶ç¶ãã¦è¡ããã大åã«ãªãã¾ããããã§ãéçºããã»ã¹ã«ããããã¹ããã©ã®ããã«åãåãã¦ãæ§ç¯ãã¦ãããã¨ããèãæ¹ã«é¢ãã¦å°ãæ´çãã¦ã¿ããã¨æãã¾ãã ããã«ãããå®æ½ããã¦ãããã¹ãã«ãã£ã¦æ¤åºã§ãã/ã§ããªãä¸å ·åãã©ã®ãããªãã®ãããããéçºä¸ã®ã©ãã§é²ããã¨ãã§ããã®ããæ´çã§ããããã«ãªã£ã¦ããã¨æãã¾ããã¾ããå®å®ãããªãªã¼ã¹ãå®ç¾ããããã®ããã«ããã¯è§£æ¶ã«åãã¦ãã©ã®ã¬ãã«ã§ãã¹ããå å®ãããã¨å¹ççã«ãããéæã§ãããã¨ããæãèãããã¨ãã§ããããã«ãªãã¾ãã ãã¹ãã¬ãã«ã«ãããã¹ãã®åºåã ãã¹ãã¬ãã«ã¨ããè¨èã«ãæ§ã ãªå®ç¾©ãããã¾ãããããã§ã¯ãã£ããã¨ãã¹ã対象ã¨ãªãç¯å²ãé åãæå³ãããã¨ã«ãã¾ã
golangã®testingããã±ã¼ã¸ã¯ã·ã³ãã«ä¸»ç¾©ã®goãªãã§ã¯ã¨ãã£ããæå°éã®æ©è½ã®ã¿ãæä¾ãã¦ãã¾ããå®éã®ã¨ããããã¾ã§ã(ã»ã¼)å åãªæ©è½ãæä¾ãã¦ããããã§ããããã¹ãåã®åæåãæ確ã«å®ç¾©ã§ããªããªã©ãä¸æºãããã¾ããã ããããããã§ã1.4ãããã®ä¸æºã解決ããtesting.Mã¨TestMain(*testing.M)ã追å ããã¦ãã¾ãããããããªãæé«ä¾¿å©ã§ãã å¾æ¥ã®ãã¯ãã㯠å½ç¶ãããã¾ã§ããã¹ãã®"åæå"ã"ãçã¥ã"ãæ¸ãããã¨ããè¦æ±ã¯å½ç¶ããã¾ãããããã«å¯¾ãã¦ã¯ãgo testã³ãã³ãããã¡ã¤ã«ãabc...é ã«èªã¿ãããã¨ãå©ç¨ãã¦ããã¡ã¤ã«åã工夫ããã¨ããã¡ãã£ã¨è£ã¯ã¶çãªææ³ãä¸è¬çã§ããã ããªãã¡ãæåã«å®è¡ããããã¹ããæ¸ããããã¡ã¤ã«ã¯ãa_test.goãã«ãã¦ãæå¾ã«å®è¡ããããã¹ãããz_test.goãã¨ããããã§ãããã®æ¹
ããã«ã¡ã¯ããã¼ã®ã§ããä»æ¥ã¯ããã°ã©ãã¼ãªãéå®ããã§ããããã¼ã«ããç´¹ä»è´ãã¾ããååããfake2dbãã¨ããã¾ãã ã©ããªãã®ï¼ ãã¡ãã¯ååã®ã¨ãããfakeããªãã¼ã¿ãDBã«å ¥ãããã¼ã«ã¨ãªãã¾ããæ¬çªç¨¼ååã®éçºæã¯ãã¡ãããæ¬çªç¨¼åå¾ãä¸å ·åã®ãã§ãã¯çã§ç¢ºèªããããæ¬çªãã¼ã¿ã¯å¥ç´ä¸ä½¿ããªããã¨ãããããªå ´åã«ãµãã¨ããã¼ãã¼ã¿ãä½ããã¨ã¨ã¦ã便å©ã§ããã æ¦è¦ ã§ã¯fake2dbã®æ¦è¦ã§ããfake2dbã¯Python製ã§pipã«ã¦ã¤ã³ã¹ãã¼ã«è´ãã¾ããããã¼ãã¼ã¿ãä½ããDBã¯sqlite, mysql, postgresql, mongodb, redisã¨å¤§ä½ã®ã¡ã¸ã£ã¼ãªDBã¯æ¼ããã¦ãããããªæãã§ãã ãã£ã¦ã¿ã ã§ã¯æ©éãã£ã¦ã¿ã¾ããããmysqlã¨postgresqlã§è©¦ãã¦ã¿ã¾ããAWSã®RDSã使ã£ã¦ããããã®DBãç«ã¦ããã¼ã«ã¤ã³ã¹ãã¼ã«ç¨ã«EC2ã
ã¯ããã« ã¿ãªããããã«ã¡ã¯ï¼ ãã®è¨äºã¯ãå¿ è¦æå°éã®åªåã§æ大éå®æ¦ã§ä½¿ããç¥èãæä¾ããRSpecå ¥éè¨äºããç¥ãã¦ã使ããRSpecå ¥éãã®ç¬¬4åã§ãã ä»åã¯Capybaraã使ã£ããã£ã¼ãã£ã¹ããã¯ã«ã¤ãã¦èª¬æãã¾ãã ãã ããä»ã¾ã§ã®è¨äºã¨ã¯ç°ãªãããã£ã¼ãã£ã¹ããã¯ã®ã¤ããããããCapybaraã®ä½¿ãæ¹ãã«éç¹ãç½®ãã¾ãã ãªããªããåå人ã®çµé¨ãããã£ã¦ããã£ã¼ãã£ã¹ããã¯ã§å°ãã®ã¯ããã®ãã©ã¦ã¶ã®æä½ã£ã¦ãã©ããã£ã¦ã³ã¼ãã§è¡¨ç¾ããã®ï¼ï¼ãã¨ããã±ã¼ã¹ã大åã ããã§ãã ãã以å¤ã¯ç¬¬1åï½ç¬¬3åã®å 容ããã®ã¾ã¾å¿ç¨ã§ããã®ã§ãç¹ã«ããã£ã¼ãã£ã¹ããã¯ã ããå°ããã¨ãããã¨ã¯ãªãã¨æãã¾ãã ä»åã¯èª¬æãã主ãªé ç®ã¯ä»¥ä¸ã®éãã§ãã ãã£ã¼ãã£ã¹ããã¯ã®åºæ¬ ãã¼ã¸ã®ç§»åãç»é¢ã®ã¯ãªãã¯ããã©ã¼ã ã®æä½ãªã© ç»é¢ããã©ã¼ã ã®æ¤è¨¼ ç»é¢ã®æä½ãæ¤è¨¼ã®å¿ç¨ãã¯ãã㯠ãã®ä»
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}