maxgreen01/go-test-analyzer: v1.2.2

Read full text
Authors: Max Green
Cited by: 0

Abstract

This incremental version focuses on additional usability improvements, more detailed documentation, and bugfixes. What's Changed ✨ New Features Analyze Command Updated parser internals to preserve comments and newlines during the refactoring process and in JSON outputs, instead of stripping them away Created an annotated example of the generated JSON output files to make it easier to interpret the analysis and refactoring results Implemented scenario detection for pointer types, including a safety check during refactoring to avoid nil pointer dereference when accessing the scenario name field Added logic to avoid using unexported struct fields if the underlying scenario data type is defined in a different package than the test itself Expanded log messages for describing test execution failures in more detail during the refactoring process Global Options Added global --timestamp-logs option to create timestamped log files (like analyzer-YYYYMMDD-HHMMSS.log) to avoid accidentally overwriting old logs Updated the --split-by-dir option to support separate per-project output locations when no output file is specified Enabled saving output files to the default output location instead of the current working directory if the --output path does not contain a directory Implemented global --build-flags and --build-env options for passing custom command-line options or environment variables to the underlying build tool while parsing Go packages Added logs for all the current configuration options for the command being executed to aid in troubleshooting Miscellaneous Added references to the ICSE NIER paper associated with this tool in the README, including detailed instructions to replicate the results Improved the Makefile to simplify building development versions Repurposed make all target to build a binary for the current platform Integrated auto-generated version numbering while building binaries Added a make help target to dynamically display available targets Introduced a new Version command to display the program's version number, the build target OS and architecture, and the Go version used to build the program 🔄 Changes Renamed --logLevel and --splitByDir options to --log-level and --split-by-dir for consistency All log files are now saved in a designated logs directory relative to the default output directory Default command output file is now named - -report.csv instead of _report.csv Renamed Statistics command's totalFiles column to totalGoFiles in CSV output 🐛 Bug Fixes JSON files generated by the Analyze command now correctly store the function contents before refactoring, instead of only showing the state after refactoring The RefactorResult field still stores the refactored function data Fixed race condition on a non-concurrent map in ExpandedStatement logic Used RefactorGenerationStatusError status instead of RefactorGenerationStatusFail for logic errors during Analyze command refactoring Stopped detecting compiled cgo files during syntax tree parsing of any project 🛠️ Internal Improvements Switched to using dave/dst Decorated Syntax Tree (DST) package instead of go/ast to allow preserving comments and newlines during analysis and refactoring Replaced the go-toolsmith/astequal package with a custom fork called dstequal for checking deep equality of DST nodes Updated Analyze command's refactoring process to clone all test functions before making any modifications, instead of just helper functions Added RefactorResult.refactorings.isHelper JSON field to indicate whether the refactored function is a helper function rather than the test function itself Isolated test execution to run within their specific package rather than the scope of the entire project Adopted go test's JSON format to determine test execution results instead of parsing regular output strings Full Changelog: https://github.com/maxgreen01/go-test-parser/compare/v1.2.1...v1.2.2

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
15 June 2026
Language
EN