assembly .net_使用.NET Assembly Diff工具管理变更

assembly .net

assembly .net

Sometimes you find yourself wanting to compare two versions of a .NET assembly as a way getting your head around all the changes that might be happening a your project. Perhaps you're writing a Framework for consumption by other developers.

有时您会发现自己想要比较.NET程序集的两个版本,以此来掌握项目中可能发生的所有更改。 也许您正在编写供其他开发人员使用的框架。

There's a few different kinds of change you want to concern yourself with.

您需要关注几种不同的变化。

First is the "public face" of your assembly - the interface or 'linking' contract it makes with other assemblies that might choose to reference it.

首先是程序集的“公开面Kong”-它与可能选择引用它的其他程序集之间的接口或“链接”协定。

Second is the semantic contract that is made. Most folks expect certain things of your assembly. They give you two "1's" and they expect a "2" in return. Sometimes people start to rely on bugs and you have to make breaking changes.

第二是达成的语义契约。 大多数人都希望大会中有某些事情。 他们给您两个“ 1”,他们期望得到“ 2”作为回报。 有时人们开始依赖错误,因此您必须进行重大更改。

Breaking changes like deletion or modification of existing assemblies can, of course, wreak havoc.

当然,诸如删除或修改现有程序集之类的重大更改可能会造成严重破坏。

One word to describe the changes that happen between versions - and many versions over time - is "churn." What percentage of the "surface area" of your assembly has changed? If a large number of things change it implies that the assembly is still being actively designed, or that the problem area isn't well understood. If very few things change and/or what does change is only additive, it implies that the assembly is fairly stable and can be counted on.

一个词来描述版本之间(以及随着时间的推移,许多版本之间)发生的更改是“搅动”。 装配的“表面积”百分比已更改? 如果大量事情发生变化,则意味着该组件仍在积极设计中,或者该问题领域没有得到很好的理解。 如果很少发生变化和/或所做的更改仅是累加的,则表示组件相当稳定并且可以依靠。

Here's some tools I use to get an understanding of what's changed between binary versions of an assembly, without resorting to source-level diffs.

我使用以下一些工具来了解程序集的二进制版本之间的变化,而无需求助于源代码级差异。

  • LibCheck - The Standard. And oldie and a goodie. We use this tool to create reports that can be generated as part of your Continuous Integration build. The reports can be given to Project Owners (non-developers) and downstream consuming developers and gives them a very clear picture of what's changed; what should we worried about, test harder, and what should we worry less about. It also helps catch inadvertent breaking changes.

    LibCheck-标准。 还有老歌和礼物。 我们使用此工具来创建报告,这些报告可以作为您的持续集成版本的一部分生成。 可以将报告提供给项目所有者(非开发人员)和下游使用开发人员,并使他们对更改内容有清晰的了解; 我们应该担心什么,更努力地测试以及我们应该减少什么担心。 它还有助于捕获意外的重大更改。

    • "This tool allows you to compare two versions of an assembly, and determine the differences. The tool reports the differences as a combination of 'removed' and 'added' APIs. The tool is limited to looking only at APIs (i.e., it can't check for behavioral changes), and only compares public differences, or changes which are deemed to be 'breaking.' The tool can be used to quickly determine what has changed between one version of your assembly and another, and can help ensure that you won't introduce any breaking changes to clients of your assembly. Instructions and intended use of the tool are described in the 'libcheck tool specification' document with the zip file"

      “此工具可让您比较部件的两个版本,并确定差异。该工具将差异报告为“已删除”和“添加” API的组合。该工具仅限于查看API(例如,它可以(不检查行为变化),并且仅比较公共差异或被认为是“重大”变化。 该工具可用于快速确定一个程序集版本与另一个程序集版本之间的更改,并且可以帮助确保您不会对程序集的客户端进行任何重大更改。带有zip文件的“ libcheck工具规范”文档”

    LibCheck - The Standard. And oldie and a goodie. We use this tool to create reports that can be generated as part of your Continuous Integration build. The reports can be given to Project Owners (non-developers) and downstream consuming developers and gives them a very clear picture of what's changed; what should we worried about, test harder, and what should we worry less about. It also helps catch inadvertent breaking changes.

    LibCheck-标准。 还有老歌和礼物。 我们使用此工具来创建报告,这些报告可以作为您的持续集成版本的一部分生成。 可以将报告提供给项目所有者(非开发人员)和下游使用开发人员,并使他们对更改内容有清晰的了解; 我们应该担心什么,更努力地测试以及我们应该减少什么担心。 它还有助于捕获意外的重大更改。

  • Reflector Diff Add-In (a member of the Reflector Add-Ins Family with source available) - This tool by Sean Hederman plugs into Reflector and shows you the differences between two binary assemblies. More low-level than LIbCheck, but again, useful when you don't have source lying around.

    反射镜差异加载项 (具有可用源代码Reflector附加组件家族的成员) -Sean Hederman的此工具插入Reflector,并向您显示两个二进制程序集之间的差异。 比LIbCheck更底层,但同样,在没有源的情况下很有用。

  • NDepend - A must-have tool for Lead Developers and those who have to manage large numbers of projects and seek to understand the big picture. Version 2.1 added a Build Comparison feature and extended the already powerful CQL (Code Query Language) to support queries across features. You can see what code metrics have changed between two versions, and answer questions like "did this project get more complicated in this version, or did our recent refactoring actually reduce complexity. Check out the screencast here and download here. It also integrates nicely with source level diffs, so you can jump from the macro-view to a micro-view and back.

    依赖 -潜在开发人员和必须管理大量项目并试图了解全局的人员的必备工具。 2.1版增加了构建比较功能,并扩展了已经强大的CQL(代码查询语言)以支持跨功能查询。 您可以看到两个版本之间的代码度量发生了变化,并回答了诸如“此项目在该版本中变得更加复杂,还是我们最近的重构确实降低了复杂性。请查看此处的截屏视频此处下载。它还与源级别差异,因此您可以从宏观视图跳转到微观视图然后返回。

Being acutely aware of what's changed and avoiding the surprise of a breaking change can greatly reduce the stress level of your whole team as you deliver. I use all three of these tools and I encourage you to check them out.

敏锐地意识到发生了什么变化并避免发生重大变化,这可以大大减轻整个团队在交付过程中的压力。 我使用所有这三种工具,并鼓励您将它们检出。

翻译自: https://www.hanselman.com/blog/managing-change-with-net-assembly-diff-tools

assembly .net

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值