The Editor-friendly path is a "custom inspector". In Unity API terms, this means extending the Editor class.
Here is a working example, but the doc link above will walk you through a lot of the details and additional options:
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(Test))]
public class TestEditor : Editor
{
private Test targetObject;
void OnEnable()
{
targetObject = (Test) this.target;
}
// Implement this function to make a custom inspector.
public override void OnInspectorGUI()
{
// Using Begin/End ChangeCheck is a good practice to avoid changing assets on disk that weren't edited.
EditorGUI.BeginChangeCheck();
// Use the editor auto-layout system to make your life easy
EditorGUILayout.BeginVertical();
targetObject.testBool = EditorGUILayout.Toggle("Bool", targetObject.testBool);
// GUI.enabled enables or disables all controls until it is called again
GUI.enabled = targetObject.testBool;
targetObject.testString = EditorGUILayout.TextField("String", targetObject.testString);
// Re-enable further controls
GUI.enabled = true;
targetObject.testInt = EditorGUILayout.IntField("Int", targetObject.testInt);
EditorGUILayout.EndVertical();
// If anything has changed, mark the object dirty so it's saved to disk
if(EditorGUI.EndChangeCheck())
EditorUtility.SetDirty(target);
}
}
Keep in mind that this script uses Editor-only APIs, so it must be placed in a folder named Editor. The above code will turn your inspector into the following:

That should get you rolling until you are more comfortable with Editor scripting.