I put together a Groovy script to monitor my coding pattern of behaviour. The idea is that I can monitor when I last changed a source file or a test source file. Initially I plan to record a few days of data and graph it. My grand plan is to use my Arduino to drive some LEDs to tell me how long it's been and indicate when I've spent to long coding, writing tests, etc.newestTest = 0
newestCode = 0
def walk(root) {
root.eachFile { file ->
if (file.name.endsWith(".java")) {
if (file.name.endsWith("Test.java")) {
newestTest = Math.max(newestTest, file.lastModified())
} else {
newestCode = Math.max(newestCode, file.lastModified())
}
}
}
root.eachDir { dir ->
if (!dir.name.startsWith(".")) {
walk(dir)
}
}
}
walk(new File("
def now = System.currentTimeMillis()
def code = (now - newestCode)/60000
def test = (now - newestTest)/60000
println "Test (minutes old): $test"
println "Code (minutes old): $code"
The Art of Agile Development: Slack
-
*19 Mar 2010* * James Shore/Agile-Book *
- Next: Stories
- Previous: Iteration Planning
- Up: Chapter 8: Planning
Full Text
The follo...
2 days ago

0 comments:
Post a Comment