testfx icon indicating copy to clipboard operation
testfx copied to clipboard

Refactor and cleanup how we store type information for test methods

Open Youssef1313 opened this issue 1 month ago • 2 comments

We have our TestMethod model. It contains multiple properties related to type information:

  • FullClassName (the semantic type)
  • ManagedTypeName (the semantic type too!)
  • DeclaringClassFullName (the syntactic type)

Semantic and syntactic type are different when inheritance is involved.

[TestClass]
public abstract class MyBaseTestClass
{
    [TestMethod]
    public void M() { }
}

[TestClass]
public class ConcreteTestClass : MyBaseTestClass
{
    // this class implicitly has the test method 'M'.
    // When it's run in context of this class, its semantic type is ConcreteTestClass, but the syntactic type is MyBaseTestClass.
}

We should find ways to reduce the information we store. Ideally, only have one property for the semantic type, and not need the syntactic type at all.

Youssef1313 avatar Dec 02 '25 21:12 Youssef1313

What is the benefit of doing this? More speed? Less memory consumed? Apis get more obvious?

nohwnd avatar Dec 03 '25 09:12 nohwnd

Potentially all of that.

Youssef1313 avatar Dec 03 '25 09:12 Youssef1313