       0
       (throw (IOException. "Java compilation error")))))
 
-(defn- load-class [dir class-name]
+(defn- load-class
   "Load a java class in a specified directory"
+  [dir class-name]
   (let [class-loader
         (URLClassLoader/newInstance
          (into-array [(-> dir .toURI .toURL)]))]
     (Class/forName (name class-name) true class-loader)))
 
-(defn- run-junit-tests [fixture-class]
+(defn- run-junit-tests
+  "Run a JUnit test using the Codewars Formatter for a given fixture-class"
+  [fixture-class]
   (let [runner (JUnitCore.)]
     (.addListener runner (CwRunListener.))
-    (.run runner (into-array [fixture-class]))))
+    (codewars.clojure.test/time
+     (.run runner (into-array [fixture-class])))))
 
-(defn- file-names [files]
+(defn- file-names
+  "Filter a sequence of files writen by write-code! and output their names"
+  [& files]
   (for [{:keys [:file-name]} files
         :when (not (nil? file-name))]
     file-name))

  (let [dir (TempDir/create "java")
        setup (when (not (empty? setup)) (write-code! "java" dir setup))
        solution (write-code! "java" dir solution)
        files (file-names [setup solution])]
    (apply compile! files)
    (-> solution
        :class-name

           [codewars.java CwRunListener]
           [java.io IOException]))

(defn- compile!
  "Compile files using the java compiler"
  [& files]
  (let [compilation-result
        (-> (ToolProvider/getSystemJavaCompiler)
            ;; TODO: write compilation errors somewhere?
