Improved security testing for git-based Gradle projects using lockfile has been developed to make it more reliable, accurate and scalable. This new approach uses dependency locking which was previously used by tools like npm and yarn, to improve the accuracy of build results. A typical gradle.lockfile contains all direct and transitive dependencies being used with their versions and configurations, allowing developers to achieve reproducible builds. To generate a lockfile, Gradle is triggered using the `dependencyLocking` feature and then a single lockfile can be generated per project for multiple configurations by utilizing a feature preview of Gradle 7.0. Using dependency locking can prevent unexpected errors introduced by transitive dependencies with dynamic versions, allowing developers to identify issues more easily. The new approach has been shown to improve the accuracy of build results compared to parsing a build.gradle file, identifying 24 dependencies and 33 issues in one scenario versus none in another.