Skip to main content

精准测试

SharpShot

SharpShot

一个专注于精准测试的工具,旨在提供一套强大而灵活的工具集,帮助开发人员和测试人员进行精细化、全面化的测试。该工具集结合了高效的测试技术和先进的分析功能,使用户能够快速、准确地识别和解决软件系统中的问题。

介绍

分析 java 项目的两次 git 提交差异对项目的影响,精准定位受影响的接口 并生成调用链数据。

实现效果

效果图

原理

  1. 通过代码改动定位代码影响,并不断遍历受影响的类和方法直至找到最上层的controller层
  2. 通过javalang语法解析获取每个Java文件的import class extends implements declarators methods 等信息
  3. 通过unidiff 解析git diff信息(diff file, added_line_num, removed_lin_num)
  4. 然后根据文件增删的代码行去判断影响了哪些类和方法,不断遍历受影响的类和方法直至找到最上层的controller层
  5. 分析出两次commit id之间代码改动所带来的影响,输出受影响的接口 并生成调用链路图。

环境部署

要求python >= 3.9

pip install sharpshot

使用说明

  1. 首先获取 gitlab 的 access_token

https://git.openutx.com/-/profile/personal_access_tokens

  1. 运行
sharpshot pr=https://git.openutx.com/utx/utx-im/-/merge_requests/370 username=utxuser access_token=xxxx

pr 为 merge request 的地址,username 为 gitlab 用户名,access_token 为 gitlab 的 access_token

Metadata

Release files for sharpshot 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sharpshot 1.0.2
File Size Uploaded
sharpshot-1.0.2.tar.gz 62.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sharpshot 1.0.2
File Interpreter ABI Platform
sharpshot-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 126.7 kB

Release files / sharpshot-1.0.2.tar.gz

Download URL sharpshot-1.0.2.tar.gz
Size 62.6 kB
Tags Source
SHA-256 checksum
How to use checksums
af8d60dcb6c26d4d9c4af609dc28c3c0bdd93a82b570c808a86313cba9f1f12b
BLAKE2b-256 checksum
How to use checksums
9f78bf90809134d05011199fc855f29b3939f908d4bab85572b81655d455c017
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.21

Release files / sharpshot-1.0.2-py3-none-any.whl

Download URL sharpshot-1.0.2-py3-none-any.whl
Size 64.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a377cc49495c65146f9747d522b50e8a5da73ec5ec91d646144108a4a35f5369
BLAKE2b-256 checksum
How to use checksums
04be368df7d1bfac8036ed3ba88f69a68d5f8f914dd7cdbada147bc309fbd893
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.21

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page